wasn't Filter supposed to be a big performance win over a Query since it eliminates the performance impact of scoring? If that was the case, is Lucene proving some alternate method of achieving a similar performance improvement?
Over the past releases, we progressively improved to Query/Collector API so that queries can detect whether scores are needed and optimize in case scores are not needed in order to eg. avoid to read frequencies or stop after the first occurence is found in the case of phrase queries (
LUCENE-6218). Everything is detected automatically now, for instance if you wrap a query in a ConstantScoreQuery, it will automatically notice that scores are not needed. If you sort by the value of a field and don't request scores, then again it will notice that scores are not needed and optimize query execution.
Something else that Filters provided but not queries was random-access support. But it was a bit incomplete since Filters had no way to tell FilteredQuery if they should rather be consumed using iteration or random-access and making the wrong decision could sometimes result in super slow queries that would try to call advance() on a DocValuesRangeQuery which doesn't use an index and needs to perform a linear scan in order to locate the next match. So we added two-phase iteration support to queries (
LUCENE-6198) which allows us to dissert queries into a fast approximation and a slow verification phase. For instance, a phrase query "A B" would return the conjunction (+A +B) as an approximation and check if it can find the two terms at consecutive positions as a verification phase.
that would have exactly the same effect (and performance gain) as the old Filter class. Is that statement 100% accurate?
If you use a query that provides an efficient approximation (such as phrase queries) as a filter, things could be considerably faster. Otherwise, things will mostly work the same way as before and you could have slight speedups or slowdowns given that we use different code paths that hotspot might optimize differently.
I will look into the deprecation comments for Filter.