lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Che Dong" <ched...@hotmail.com>
Subject Re: Using doc.id() to sort
Date Tue, 15 Apr 2003 02:59:05 GMT
Yes, here is my implement;
http://www.chedong.com/tech/lucene_ext.tar.gz
including a IndexOrderSearcher

Che, Dong
http://www.chedong.com/

----- Original Message ----- 
From: "Aviran Mordo" <amordo@infosciences.com>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Tuesday, April 15, 2003 3:41 AM
Subject: Using doc.id() to sort


> I've noticed that whenever I add document to the index the doc.id() gets
> the next number.
> I use this behavior in order to sort the results by sorting the
> doc.id().
> Let me explain: If I insert the documents in a specific order to the
> index then the order is kept using the doc.id(). Now when I retrieve the
> documents after search I can use the doc.id 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?
>
Mime
View raw message