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
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
Hello Illia,
Hope you are well.
Just wanted to bring this topic back up since it was last updated more than 5 years ago. Is there anything new on the way FM is integrated with Elasticsearch and the way dates are handled. I would appreciate if you could suggest the best way to ingest dates in ES so that FM can present drill-down pivots and charts by year/month/quarter/day, etc.
Many thanks,
Stan
Hello Stan,
Thank you for writing to us.
Please note that nothing has changed in how Flexmonster integrates with Elasticsearch regarding date hierarchies. Flexmonster cannot split date fields into multilevel hierarchies on the client side because of how ES queries are generated. The available approach remains the same - you can use the interval property in the mapping to group dates by a specific interval, like year or month.
Additionally, we would like to mention that you can create a hierarchy-like structure for dates by including separate fields for years, months, quarters, and days present in the Elasticsearch data. These fields can then be separately added to the slice object:
columns: [
{
uniqueName: "Year",
},
{
uniqueName: "Month",
},
],
We have prepared an example illustrating this approach: https://jsfiddle.net/flexmonster/0sc9ft32/
Please let us know if our answer helped you.
Best regards,
Maksym
Hello Stan,
Hope you are doing well.
Our team would like to know if you have tried including separate fields for years, months and days to implement a hierarchy-like date structure.
Please let us know if this approach would work for you as an alternative to date hierarchies.
Best regards,
Maksym