lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: CachedQuery
Date Thu, 10 Jun 2004 13:50:08 GMT
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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message