lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <>
Subject How do lucene IDs work with MultiReader and MultiSearcher?
Date Tue, 21 Jun 2005 13:19:52 GMT

I've been scanning the JavaDocs, but I can't see anything on this.

Let's say I have two indexes. Both have just been optimised, so each have 
lucene IDs 1-10 in them.

Now, I build a MultiSearcher over these two indexes. I search, get back a 
Hits object, and from that a lucene ID

>From my testing, it seems that the MultiSearcher has handily offset all 
the lucene IDs from the second index, so they don't clash with the first. 
It also seems that if I pass that ID to a MultiReader built on the same 
set of indexes, I get the right document back.

(i.e. my hits object gives me a lucene ID of 5 for my first hit, and if I 
ask the multireader for document with lucene ID 5, I get the same 

Is this always going to be the case? Do I simply have to ensure that I 
open the MultiReader and MultiSearcher with the indexes in the right order 
to ensure the lucene IDs will be identically munged, or is it trickier 
than that?


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

View raw message