lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shashi Kant <>
Subject Re: how can I merge indexes without deleting the original index?
Date Fri, 04 Sep 2009 13:51:17 GMT
Here is some code to help you along.  This should leave the source
indices intact and merges them into a destination.

                //the index to hold our merged index
                IndexWriter iw = new IndexWriter(dest, new
StandardAnalyzer(), true);

                string[] sourceIndices; //an array containing the sources
               // the directory containing the "source" indices
                foreach (string si in sourceindices)
                    IndexReader r = IndexReader.Open(si);
                    iw.AddIndexes(new IndexReader[] { r });


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message