lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Query Filters on term A in query "A AND (B OR C OR D)"
Date Thu, 13 Nov 2003 20:40:14 GMT
On Thursday, November 13, 2003, at 03:28  PM, Dan Quaroni wrote:
> To my knowledge the answer is No, lucene performs each query 
> separately and
> then performs the joins after it has all the results.  This is 
> actually a
> rather serious problem when it comes to searches in large indexes 
> where a
> single field is very important but has a very low uniqueness.
> For example, if you were searching for a telephone number for a 
> company in a
> lucene index of all of the companies in the US and you knew the state, 
> city,
> and name, the query would come up being something like:
> name:Bob's Discount Furniture AND state:California AND city:San Diego
> Now, that query is going to retrieve EVERY Bob's discount furniture, 
> company in California, and EVERY city in San Diego and then join them. 
>  That
> makes the memory requirements for this query far higher than they 
> really
> need to be.

If you know ahead of time that queries of this type would be made, then 
it could be "optimized" by doing the query that has the fewest hits 
first, then using a QueryFilter for successive queries to narrow it to 
the precise criteria.  Granted this doesn't help when the queries can 
be entered free-form via QueryParser.


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

View raw message