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, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
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:[EMAIL PROTECTED]
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 <[EMAIL PROTECTED]>:
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]