lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: TopDocCollector vs TopScoreDocCollector (semantics changed in 4.0, not backward comptabile)
Date Wed, 27 Feb 2013 22:02:40 GMT
You have to use the IndexReader that you get via Collector.setNextReader(AtomicReaderContext
ctx). The context will provide you with the correct atomic reader and the correct document
base for collecting documents with collect (all ids are relative to the context).

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: saisantoshi [mailto:saisantoshi76@gmail.com]
> Sent: Wednesday, February 27, 2013 10:39 PM
> To: java-user@lucene.apache.org
> Subject: Re: TopDocCollector vs TopScoreDocCollector (semantics changed in
> 4.0, not backward comptabile)
> 
> I want to get the Document in the following below code and thats why I need
> an indexReader
> 
> public void collect(int doc) throws IOException {
>     // ADD YOUR CUSTOM LOGIC HERE
> 
> *    Document doc = indexReader.document(doc)*
>     delegate.collect(doc);
>   }
> 
> 
> But this seems to be the problem as the indexReader is fetching an incorrect
> document. Do you think that there are any concurrency issues here?
> 
> Thanks,
> Sai.
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/TopDocCollector-vs-
> TopScoreDocCollector-semantics-changed-in-4-0-not-backward-comptabile-
> tp4035806p4043488.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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