lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramy Hardan <>
Subject Re: Search Refinement Approaches
Date Sun, 08 Feb 2004 23:48:45 GMT
Hello Dror,

Sunday, February 8, 2004, 7:35:32 PM, you wrote:

> Hi Ramy,

> Maybe I'm misunderstand the question but wouldn't creating a 
> that ANDs the original query and the new one do what you want?

You are absolutely right. This approach would yield the desired
result. But what I'm concerned about is to find the most performant
way of achieving this. I'm afraid that queries become slower as they
get more complex (the refinement levels increase). The bottom line
probably is that I have to implement the different strategies and
compare their performance.

Thanks and best regards


> On Sat, Feb 07, 2004 at 11:32:35PM +0100, Ramy Hardan wrote:
>> Hi,
>> Reviewing javadocs and previous posts, search refinement or 'search
>> within search' is best done with a Filter. To fill the Filter's BitSet
>> with the results of a search, a HitCollector is the obvious solution.
>> Unfortunately when using HitCollector I have to implement all the
>> functionality the Hits class usually provides myself.
>> Is there an efficient way to search refinement preferably without
>> losing the Hits class? I can think of the following approaches:
>> - Don't use Hits: collect all scores and document numbers with a
>>   HitCollector and sort them by score after the search. Retrieve the
>>   needed documents from IndexReader via document number.
>> - Use Hits: Briefly examining the source reveals this possiblilty:
>>   subclass BitSet and override the boolean get(int bitIndex) method to
>>   additionally set the bit at bitIndex in another BitSet. Use this
>>   subclass in a Filter and initialize it with all ones (in the first
>>   search). This way I can tell which documents are tested by the
>>   IndexSearcher against the Filter by examining the second BitSet and
>>   use it as a Filter for the refining search. Here's a scetch of this
>>   for clarification:
>>   public class FilterBitSet extends BitSet {
>>     private BitSet bitsForRefiningFilter;
>>     public boolean get( int bitIndex ) {
>>       boolean result = super.get( bitIndex );
>>       if (result) bitsForRefiningFilter.set( bitIndex );
>>       return result;
>>     }
>>   }
>>   Is this really possible? (might be more of a question for dev)

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

View raw message