--- Erik Hatcher <[EMAIL PROTECTED]> wrote:
> 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, 
> > EVERY
> > 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.
> 
>       Erik

Erik, Just to make sure I understand you right, In an
example query:  ZipCode:CA10927 AND Gender:Male 

Sure I know ZipCode returns fewer results, do you mean
I build a filter 

QueryFilter x = new QueryFilter("ZipCode", "CA10927",
..);

Then build the query

Query y = QueryParser.parse("Gender:Male", "Gender",
..);

Then run it

Hit result = searcher.search(y, x);

I tried that, and the performance does not improve.
when I trace down the code, I found searcher object
searches on both ZipCode and Gender for terms
information (expesive) before processing on the
filters.

Am I doing something wrong, or you mean something
else? I would really appriciate if you can post an
example to this list, or send a copy of to my mail
address at [EMAIL PROTECTED]

Kind Regards
 

> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to