Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 19139 invoked from network); 17 Nov 2005 11:57:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Nov 2005 11:57:15 -0000 Received: (qmail 39900 invoked by uid 500); 17 Nov 2005 11:57:09 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 39877 invoked by uid 500); 17 Nov 2005 11:57:08 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 39866 invoked by uid 99); 17 Nov 2005 11:57:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2005 03:57:08 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [69.55.225.129] (HELO ehatchersolutions.com) (69.55.225.129) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2005 03:58:42 -0800 Received: by ehatchersolutions.com (Postfix, from userid 504) id A64CB13E2033; Thu, 17 Nov 2005 06:56:46 -0500 (EST) Received: from [192.168.1.104] (68-232-111-194.chvlva.adelphia.net [68.232.111.194]) by ehatchersolutions.com (Postfix) with ESMTP id DB8F713E2008 for ; Thu, 17 Nov 2005 06:56:17 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v734) In-Reply-To: References: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <2B11176E-F2D5-45BD-82ED-825720BEA516@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Is there a tool that merges Lucene indexes? Date: Thu, 17 Nov 2005 06:56:33 -0500 To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.734) X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on javelina X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00, RCVD_IN_NJABL_DUL,RCVD_IN_SORBS_DUL autolearn=no version=3.0.1 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 17 Nov 2005, at 03:37, Oren Shir wrote: > Does Luke, Lucli, or any of the existing tools enable merging Lucene > indexes? No, none of those tools do it, but it is all of about 10 lines of code: public class IndexMergeTool { public static void main(String[] args) throws IOException { File mergedIndex = new File(args[0]); IndexWriter writer = new IndexWriter(mergedIndex, new SimpleAnalyzer(), true); Directory[] indexes = new Directory[args.length - 1]; for (int i = 1; i < args.length; i++) { indexes[i - 1] = FSDirectory.getDirectory(args[i], false); } writer.addIndexes(indexes); writer.optimize(); writer.close(); } } We could add this to contrib/utils or something, possibly. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org