lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sharma, Siddharth" <Siddharth.Sha...@Staples.com>
Subject RE: Too many clauses
Date Wed, 19 Oct 2005 18:05:59 GMT
Thanks Chris

I haven't tried it yet, but I think I understand your idea now (after 24
hours, man I'm slow on the uptake;)
I'll try it today.
-Sid


-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: Monday, October 17, 2005 5:05 PM
To: java-user@lucene.apache.org
Subject: Re: Too many clauses

:
: To circumvent it, here are a few options that I have thought of:
: 1. Chunk it up:
:   a. Create a filter based on a query that has a maximum of 1024.
:   b. Get its bits.
:   c. Get the next 1024 blocked skus and create a filter out of it and get
:      its bits.
:   d. AND the two BitSets.
:   e. Do this till all blocked skus and other filters are ANDed together
for
:      the final BitSet.

Instead of building up your filter based on a query, why not build up your
filter directly? ... Using a QueryFilter requires that scoring happen --
but you don't care about the scoring, you just want to know if a doc
matches a keyword or not.  Take a look at the way RangeFilter is
implimented.  it should be able to searve as a good example of how you can
write a "SetFilter" that takes in a field name and a set of keywords, and
only "passes" documents where one of the keywords shows up as an indexed
value for that field.  Now you don't have toworry baout the 1024 limit,
you don't have to "chunk" anything, your searches will be faster because
you don't need to worry about the scoring aspects of a the BooleanQueries.


Hint: you can sort the input Set, and then iterate over it, pulling out
the TermDocs for each, and scoring each doc in each TermDocs.  now your
Filter indicates all the products that do match those skus, and you'll
want an "InverseFilter to wrap it and indicate all the products that
*don't* match those skus.



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message