lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aviran Mordo" <>
Subject Using to sort
Date Mon, 14 Apr 2003 19:41:58 GMT
I've noticed that whenever I add document to the index the gets
the next number.
I use this behavior in order to sort the results by sorting the
Let me explain: If I insert the documents in a specific order to the
index then the order is kept using the Now when I retrieve the
documents after search I can use the to sort the hits in the
order it was inserted to the index.
Now here comes my question. What happens if I want to merge two indexes.
Using IndexWriter.addIndexes(Directory[] dirs) method I would like to
add one index to another. Now my question is if the documents will get
added also in the order they were inserted.
Example: if
index 1 contains IDs: 10,11,12,13,14,15
and index 2 contains IDs: 1,2,3
After I use IndexWriter.addIndexes(Directory[] dirs) to add index 2 to
index 1 will I get: 10,11,12,13,14,15,16,17,18
Where document number 16 in the merged index is document number 1 in
index 2, and 17 in the merged index is 2 in index 2, and 18 in the
merged index is 3 in  index 2 ?
If this is not the case, how can I do that?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message