Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 1266 invoked from network); 20 Aug 2003 00:49:31 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 20 Aug 2003 00:49:31 -0000 Received: (qmail 13780 invoked by uid 97); 19 Aug 2003 23:52:16 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 13772 invoked from network); 19 Aug 2003 23:52:16 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 19 Aug 2003 23:52:16 -0000 Received: (qmail 55941 invoked by uid 500); 19 Aug 2003 23:47:44 -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 55683 invoked from network); 19 Aug 2003 23:47:37 -0000 Received: from host-64-65-202-3.pro.choiceone.net (HELO contextmedia.com) (64.65.202.3) by daedalus.apache.org with SMTP; 19 Aug 2003 23:47:37 -0000 Received: from jwilkicki ([192.168.1.192]) by contextmedia.com ; Tue, 19 Aug 2003 17:43:56 -0400 From: "Joseph Wilkicki" To: "Lucene User" Subject: Error merging indices with Lucene 1.3 RC1 Date: Tue, 19 Aug 2003 17:42:44 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal X-Rcpt-To: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi all! I am working with Lucene 1.3 RC1 and found what I think is a problem. Basically, I am indexing into a RAMDirectory and then using addIndexes to merge the RAMDirectory into a file system index. Adding in a small number of documents doesn't seem to work. My test code is like this: Directory memDir = new RAMDirectory(); File tempDir = new File(System.getProperty("user.dir"), "test2"); Directory fsDir = FSDirectory.getDirectory(tempDir, true); IndexWriter fsWriter = new IndexWriter(fsDir, new StandardAnalyzer(), true); IndexWriter memWriter = new IndexWriter(memDir, new StandardAnalyzer(), true); Document toAdd1 = createADocument(); // creates a random document Document toAdd2 = createADocument(); memWriter.addDocument(toAdd1); memWriter.addDocument(toAdd2); String[] files = memDir.list(); for(int i=0;i<1;i++){ System.out.println(files[i]); // Only lists "segments" file, no data files } fsWriter.addIndexes(new Directory[] { memDir }); fsWriter.close(); IndexReader reader = IndexReader.open(FSDirectory.getDirectory(tempDir, false)); Document toCompare = reader.document(1); // Results in ArrayIndexOutofBoundsException reader.close(); tempDir.delete(); I should be able to get the document at index 1, but it fails. If I add in 12 documents by doing this: memWriter.addDocument(toAdd1); memWriter.addDocument(toAdd2); for(int i=0;i<10;i++){ memWriter.addDocument(createADocument()); } I only see 10 documents returned by IndexReader.termDocs(Term) on the FSDirectory after I merge the RAMDirectory in. Any insights on why this may be? Am I doing something wrong in this code? Thanks in advance for any insights. Joe W. --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org