Do additional date range filters increase the performance? Do additional date range filters increase the performance? elasticsearch elasticsearch

Do additional date range filters increase the performance?


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.