Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 20804 invoked from network); 14 Apr 2003 19:42:01 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 14 Apr 2003 19:42:01 -0000 Received: (qmail 18431 invoked by uid 97); 14 Apr 2003 19:43:59 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 18424 invoked from network); 14 Apr 2003 19:43:59 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 14 Apr 2003 19:43:59 -0000 Received: (qmail 20392 invoked by uid 500); 14 Apr 2003 19:41:56 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 20318 invoked from network); 14 Apr 2003 19:41:55 -0000 Received: from unknown (HELO isc?mail.infosciences.com) (141.156.69.115) by daedalus.apache.org with SMTP; 14 Apr 2003 19:41:55 -0000 Received: from Aviran (141.156.69.109 [141.156.69.109]) by isc_mail.infosciences.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id ZX7W251F; Mon, 14 Apr 2003 15:46:04 -0400 From: "Aviran Mordo" To: "Lucene Users List" Subject: Using doc.id() to sort Date: Mon, 14 Apr 2003 15:41:58 -0400 Message-ID: <00d601c302bd$ef7d8100$6a00a8c0@Aviran> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00D7_01C3029C.686BE100" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_00D7_01C3029C.686BE100 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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? ------=_NextPart_000_00D7_01C3029C.686BE100--