Hi,

That'a the way to go! With this method, you don't need to use FilteredQuery, it 
is done under the hood automatically.
Please take care that Collector works, in contrast to HitCollector, per index 
segment (setScorer/setNextReader), so you have to rewrite at least most of you 
collection code so it is able to use the relative document IDs.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: [email protected]


> -----Original Message-----
> From: saisantoshi [mailto:[email protected]]
> Sent: Wednesday, January 23, 2013 1:01 AM
> To: [email protected]
> Subject: RE: IndexSearcher.search(Weight weight, Filter filter, HitCollector
> results) is not there in 4.0 version
> 
> Thanks.
> 
> Can we use the following method in 4.0 as a replacement for the above
> method? However, we will rewrite this to use FilteredQuery later but don't
> want to refactor a lot.
> 
> public void search(Query query,
>           Filter filter,
>           Collector results)
>             throws IOException
> 
> http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/search/Inde
> xSearcher.html#search%28org.apache.lucene.search.Query,%20org.apache.l
> ucene.search.Filter,%20org.apache.lucene.search.Collector%29
> 
> In this way, I can pass the native query (instead of the weight) and pass in
> the filter and a TopDocsCollector instance.
> 
> Thanks,
> Sai.
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/IndexSearcher-search-Weight-weight-
> Filter-filter-HitCollector-results-is-not-there-in-4-0-version-
> tp4035488p4035490.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to