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: u...@thetaphi.de > -----Original Message----- > From: saisantoshi [mailto:saisantosh...@gmail.com] > Sent: Wednesday, January 23, 2013 1:01 AM > To: java-user@lucene.apache.org > 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: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org