lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Armbrust <>
Subject Re: Lucene Document order not being maintained?
Date Wed, 05 Apr 2006 20:08:59 GMT
Chris Hostetter wrote:
> : exactly the same as how I insert them.  Lucene is supposed to maintain
> : document order, even across index merges, correct?
> Lucene definitely maintains index order for document additions -- but i
> don't know if any similar claim has been made about merging whole indexes.
> : this until I'm done with all of the documents.  Then, as a last step, I
> : open up a new empty index, and I call addIndexes(Directory[]) - and I
> : pass in the directories in the same order that I created them.
> 	...
> : The problem that I am seeing right now, is that when I look into my
> : large combined index with Luke, Document number 899 is the 899th
> : document that I added.  However, Document 900 is the 49860th document
> : that I added.  This continues until Document 910, where it suddenly
> : jumps to the 99720th document.
> As I said, i'm not sure if it's a bug or undefined behavior, but
> can you post a self contained JUnit test demonstrating this? -- that way
> people can look at exactly what is going on (if it is a bug).
> -Hoss
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Well, I set out to write  JUnit test case to quickly show this... but 
I'm having a heck of a time doing it.  With relatively small numbers of 
documents containing very few fields... I haven't been able to recreate 
the out-of-order problem.  However, with my real process, with a ton 
more data, I can recreate it every single time I index (it even gets the 
same documents out of order, consistently).

I'll continue to try to generate a test case that gets the docs out of 
order... but if someone in the know could answer authoritatively whether 
or not lucene is supposed to maintain document order when you merge 
multiple indexes together, that would be great.



Daniel Armbrust
Biomedical Informatics
Mayo Clinic Rochester

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

View raw message