Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Elasticsearch Dates – are date hierarchies possible in Flexmonsters

Answered
Mark Spicer asked on July 3, 2020

I have an Elasticseach index which contains a number of dates in, I presume, ISO8601 format. In Flexmonster, it is possible to display those dates in a hierarchy – e.g. Year, Month Day?
I have tried setting a mapping like this:

report: {
"dataSource": {
"dataSourceType": "elasticsearch",
"node": "http://localhost:3000",
"index": "data",
"mapping": {
"Reported Date": {
type: "year/month/day"
}
}
}
}

…but that doesn’t seem to do anything. I could not find any of your Elasticsearch examples showing dates being displayed. Is this a feature that Flexmonster provides or do I have to modify something in Elasticsearch to get date hierarchies in Flexmonster?
Thanks

1 answer

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster July 3, 2020

Hello, Mark,
 
Thank you for reaching out to us.
 
Our team would like to kindly explain that Elasticsearch does not provide the possibility to split the date on the multilevel hierarchy. At the same time, Flexmonster cannot split the received date on the client-side due to the specific of queries generation.
Therefore, the date can not be split when using Elasticsearch as a data source.
 
Even so, it is possible to use the interval property in order to group the field by the specific interval.
Such property should be specified within the mapping object.
Please see an example demonstrating grouping dates by months.
 
Detailed information about the mapping object and its properties can be found in our documentation.
 
We hope it works for your case.
Please contact us in case other questions occur.
 
Regards,
Illia

Please login or Register to Submit Answer