lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <>
Subject What doc id to use on IndexReader with SetNextReader
Date Mon, 18 Apr 2011 09:18:01 GMT
Migrating some code from 2.3.2 to 2.9.4 and I have custom Collectors.

Now there are multiple calls to collect and each call needs to adjust the passed 
doc id by docBase as given in SetNextReader.

However, if you want to fetch the document in the collector, what 
docId/IndexReader combination should be used.

Given that

collect(int doc)
setNextReader(IndexReader reader, int docBase)

I have tested the following two which seem to get the same document

Document d = searcher.getIndexReader.document(doc + docBase)
Document d = reader.document(doc)

Is this guaranteed to always be the case and how the APIs should be used?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message