lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: sub search
Date Tue, 07 Mar 2006 14:05:13 GMT
On Mar 7, 2006, at 7:03 AM, hu andy wrote:
> It uses cache mechanism. The detail is described in the book Lucene in
> Action. Maybe you can test it to decide which is faster

Major caveat here is that the caching QueryFilter employs really only  
works if you use the same instance of QueryFilter for successive  
searches using the same IndexReader (via IndexSearcher) instance.  If  
you're simply using a previous query to AND the current query and the  
previous query is not something that will be reused later, the  
BooleanQuery AND option is what I recommend.

	Erik


>
> 2006/3/7, anton@orbita1.ru <anton@orbita1.ru>:
>>
>> As far as I understood that will make new search throughout the  
>> index. But
>> what the difference between that and search described below:
>>
>> TermQuery termQuery = new TermQuery(....
>> BooleanQuery bq = ..
>> bq.add(termQuery,true,false);
>> bq.add(query,true,false);
>> hits = Searcher.search(bq,queryFilter);
>>
>>
>>
>> -----Original Message-----
>> From: hu andy [mailto:andyhugb@gmail.com]
>> Sent: Tuesday, March 07, 2006 12:40 PM
>> To: java-user@lucene.apache.org
>> Subject: Re: sub search
>> Importance: High
>>
>> 2006/3/7, Anton Potehin <anton@orbita1.ru>:
>>>
>>> Is it possible to make search among results of previous search?
>>> For example: I made search:
>>> Searcher searcher =...
>>> Query query = ...
>>> Hits hits = ....
>>> hits = Searcher.search(query);
>>> After it I want to not make a new search, I want to make search  
>>> among
>>> found results...
>>>
>>> You can use like this
>>
>> TermQuery termQuery = new TermQuery(....
>> Filter  queryFilter = new QueryFilter(temQuery);
>> hits = Searcher.search(query,queryFilter);
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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