------- Additional Comments From [EMAIL PROTECTED] 2005-01-06 20:13 ------- Patch to IndexSearcher.java to use FilteredQuery
I like where this is going, and want to take it further!
Why not patch Searcher.java instead of IndexSearcher.java? Once that's done, Filters could be removed from the Searchable interface and only appear (for back-compatibility and/or convenience) in Searcher utility methods.
This would simplify auto-filtering. Instead of a Query -> Query+Filter transformation, we could just use a Query -> Query transformation. For example, the rewrite method on BooleanQuery could look for clauses which are somehow declared non-scoring (e.g., boost=0) and, when these exist, rewrite itself as a FilteredQuery, constructing a Filter for all of the non-scoring clauses.
There's still the issue of caching filters. This might be as simple as:
(a) combine the caches used by QueryFilter and CachingWrappingFilter;
(b) implement the unified cache as an LRU, possibly taking into account different filter sizes, etc.
(c) add a Query.getFilterBits(IndexReader, DocIdCollector) method that's implemented with a Scorer by default, but which may be optimized, e.g., for RangeQuery, TermQuery, etc.
(d) write a BooleanQueryFilter implementation that uses Query.getFilterBits() to combine a number of clauses into a single bit-vector that can be cached.
Does this make any sense?
Doug
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]