I know the title might suggest it is a duplicate but I haven't been able to find the answer to this specific issue:
I have to filter search results based on a date range. Date of each document is stored (but not indexed) on each one. When using a Filter I noticed the filter is called with all the documents in the index.
This means the filter will get slower as the index grows (currently only ~300,000 documents in it) as it has to iterate through every single document.
I can't using RangeQuery since the date is not indexed.
How can I apply the filter AFTER only on the documents that are the results of the query to make it more efficient?
I prefer to do it before I am handed the results not to mess up the scores and collectors I have.