To an existing, large ElasticSearch 5 index, I want to add a date
field, containing the date of the indexation of each document. Afterwards I want to query this index, to return all documents, created in the last minute.
In the ElasticSearch Ultimative Guide for version 1 it is mentioned, that adding additional filters for day, month and/or year can improve the performance drastically. Newer versions of the guide do not say so anymore.
Can I gain performance in ElasticSearch 5 with adding additional date filters?
Date Range Filters are used to limit the results on a Dashboard to data that falls in (or outside of) certain date and time groupings. Date Range Filters are available for properties with Date, DateTime, and Time data types.
To maintain the automatic updates, add the date variable as a Filter > Range of dates > Special > All dates. Now, the table will update to the most recent date inside of the date filters range.
Depending on the size of your index, it certainly would help restrain the amount of data that gets considered for your query.
If your index contains years of data, adding a filter to only consider the documents indexed during the last minute will considerably decrease the amount of data that will be focused on for your query.
It was the case with ES 1.x and it is still the case with ES 5.x, the only difference is that in 1.x you had to take care of properly ordering your filters to use the most aggressive filters first, which is not the case anymore in 5.x as ES is now smart enough to run the most aggressive filters first to make sure to weed out unnecessary data very early during the search process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With