CDRH / api

Codenamed "Apium": An API to access all public Center for Digital Research in the Humanities resources
https://cdrhdev1.unl.edu/api_frontend
MIT License
3 stars 1 forks source link

Facet custom date ranges -- discussion #59

Closed jduss4 closed 6 years ago

jduss4 commented 6 years ago

Would it be desirable to allow facets for custom date ranges? For example:

Early Life (1890 - 1908): 24
College (1909 - 1912): 40
Army Years (1913 - 1919): 84

Ignore the labels, the important part would be the date range itself. I imagine that it would be to the day level, in case we have projects with events that span only a week or two. We might also want to build a centuries query for things like EEBO, browsing all our collections, etc.

I see two separate issues here:

centuries / decades / set time periods

Because Elasticsearch doesn't seem to natively support decades / centuries facets the way they do years, I think it would be beneficial to make up our own syntax to send in those types of requests and then manually construct a query on the API end to send to ES. Essentially a shorthand for the facet request.

truly custom ranges

Come up with some sort of syntax so that several ranges of (possibly overlapping) dates can be requested.

jduss4 commented 6 years ago

@karindalziel has recommended that we take care of this with a custom (keyword) field which can be faceted upon. So on ingest, documents would be organized by decade, custom time range, etc, but elasticsearch would not need to construct these ranges via query.