Closed jduss4 closed 6 years ago
Will probably have to use date range query to get at decade and century, unfortunately.
However, you can do something like this, if you don't care that much about accuracy!
"date.3650d": {
"1890-01-20": 450,
"1910-01-16": 349,
"1920-01-14": 330,
"1880-01-23": 204,
"1900-01-18": 187,
"1930-01-11": 139,
"1950-01-06": 138,
Date histogram docs (what API uses now): https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html
Date range docs (what API may need to use for decade / century): https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-daterange-aggregation.html
For now let's handle this using custom fields on ingest
Right now
date_field.year
is supported, but we should implement some more non-adjustable ranges, alsoIf these are implemented, the behavior should be implementable if the backend was switched to solr.