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 Thu, 28 Feb 2013 18:34:01 GMT
Hi,

I answered you question parallel to your second mail. This is not a new change in Lucene 4,
its like that since Lucene 2.9/3.0.
You may also read: http://blog.thetaphi.de/2012/02/is-your-indexreader-atomic-major.html

The comment to your code: Don't pass a IndexReader to the ctor of your collector, instead
*implement* setNextReader in your collector and use the passed AtomicReaderContext to get
an AtomicReader. The document IDs passed to collect(int) are not global, they are only valid
to the current atomic reader (as Lucene search is working segment-wise and not globally).

Uwe

-----
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: Thursday, February 28, 2013 7:26 PM
> To: java-user@lucene.apache.org
> Subject: RE: TopDocCollector vs TopScoreDocCollector (semantics changed in
> 4.0, not backward comptabile)
> 
> Could someone please comment on the above code snippet ?
> 
> Also, one observation is that our search results are not consistent if we are
> using* IndexReader vs AtomicReader?* Could this be a problem?
> 
> Thanks,
> Sai.
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/TopDocCollector-vs-
> TopScoreDocCollector-semantics-changed-in-4-0-not-backward-comptabile-
> tp4035806p4043719.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