On Jun 10, 2004, at 9:17 AM, Eric Jain wrote:
> I noticed that searching for terms that appear in a significant number
> of documents tends to be relatively slow. For example
>
> foo AND (bar:yes OR xyz)
>
> where every document has a field 'bar' with a value of either 'yes' or
> 'no'. Had a look at CachingWrapperFilter, unfortunately this class
> doesn't seem to be any help here. Perhaps I need to create a
> CachedQuery
> class that caches Weight objects for wrapped Query objects (and
> subclass
> QueryParser to make use of this)? But would this work? Any ideas?
How about the new FilteredQuery (added in the latest Lucene 1.4 release
- or earlier?). I'm not sure it would suffice for that particular
query though. It would, however, work well for:
foo OR (bar:yes AND xyz)
as you could use a QueryFilter on bar:yes nested in a FilteredQuery
with a TermQuery for xyz, and then wrapped in a BooleanQuery as two
non-required clauses. As for QueryParser... FilteredQuery is not
currently supported, although you could perhaps inject it by
subclassing (?).
Maybe FilteredQuery would work for you? But I'm not seeing how with
the query you provided.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
|