lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <>
Subject Re: Queries not derived from the text index
Date Wed, 08 Feb 2006 23:31:42 GMT
John Powers wrote:
> This may be a tangent, but for my filters and searches, I construct the
> query with "+" and "-" and what not..   is this not the right way to do
> this?    I haven't had to extend or write any special AND or OR classes,
> I just write the query and search the once.     Any advantage to writing
> Filter subclasses?

In our particular case, most of our filters have absolutely nothing to 
do with the contents of the text index, so they can't be done as queries 

For instance, we can filter the search results based on the result of a 
query to a database.  Lucene doesn't allow us to modify a Document after 
it's created, so we use a database as a workaround for this limitation. 
  Historically we used to support user annotations by deleting and 
re-adding the document, but this process is too slow if the user wants 
to annotate multiple documents in a single pass.

The only other benefit to using a Filter instead of a Query (for example 
using QueryFilter) is the ability to cache the results of something 
you're going to use a lot.  For instance, you might have a UI which 
allows the user to filter by dates.  The user might enter multiple 
queries in a single given date range, and using a filter here avoids 
performing the range query multiple times.


Daniel Noll

Nuix Australia Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia
Phone: (02) 9280 0699
Fax:   (02) 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

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

View raw message