Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change 
notification.

The "MergingSolrIndexes" page has been changed by MarcUbaldino:
http://wiki.apache.org/solr/MergingSolrIndexes?action=diff&rev1=11&rev2=12

   1. Find the lucene jar file that your version of solr is using. You can do 
this by copying your solr.war file somewhere and unpacking it (jar xvf 
solr.war). Your lucene jar file should be in WEB-INF/lib. It is probably called 
something like lucene-core-2007-05-20_00-04-53.jar. Copy it somewhere easy to 
find.
   1. Download a copy of lucene from 
http://www.apache.org/dyn/closer.cgi/lucene/java/ and unpack it. The file 
you're interested in is  contrib/misc/lucene-misc-VERSION.jar
   1. Make sure both indexes you want to merge are closed.
-  1. Issue this command: {{{java -cp 
/path/to/lucene-core-VERSION.jar:/path/to/lucene-misc-VERSION.jar 
org/apache/lucene/misc/IndexMergeTool /path/to/newindex /path/to/index1 
/path/to/index2}}} This will create a new index at {{{/path/to/newindex}}} that 
contains both index1 and index2. Copy this new directory to the location of 
your application's solr index (move the old one aside first, of course) and 
start solr.
+  1. Issue this command: {{{java -cp 
/path/to/lucene-core-VERSION.jar:/path/to/lucene-misc-VERSION.jar 
org.apache.lucene.misc.IndexMergeTool /path/to/newindex /path/to/index1 
/path/to/index2}}} This will create a new index at {{{/path/to/newindex}}} that 
contains both index1 and index2. Copy this new directory to the location of 
your application's solr index (move the old one aside first, of course) and 
start solr.
  
  === Example ===
  The command below assumes that the files {{{lucene-core-3.4.0.jar}}} and 
{{{lucene-misc-3.4.0.jar}}} are in the current directory:
  {{{
- java -cp lucene-core-3.4.0.jar:lucene-misc-3.4.0.jar 
org/apache/lucene/misc/IndexMergeTool ./newindex ./app1/solr/data/index 
./app2/solr/data/index
+ java -cp lucene-core-3.4.0.jar:lucene-misc-3.4.0.jar 
org.apache.lucene.misc.IndexMergeTool ./newindex ./app1/solr/data/index 
./app2/solr/data/index
  }}}
  

Reply via email to