Apache Solr Documentation

5.3 Ref Guide (PDF Download)
Solr Tutorial
Solr Community Wiki

Older Versions of this Guide (PDF)

5.4 Draft Ref Guide Topics


This Unreleased Guide Will Cover Apache Solr 5.4

Skip to end of metadata
Go to start of metadata


If you need to combine indexes from two different projects or from multiple servers previously used in a distributed configuration, you can use either the IndexMergeTool included in lucene-misc or the CoreAdminHandler.

To merge indexes, they must meet these requirements:

  • The two indexes must be compatible: their schemas should include the same fields and they should analyze fields the same way.
  • The indexes must not include duplicate data.

Optimally, the two indexes should be built using the same schema.

Using IndexMergeTool

To merge the indexes, do the following:

Before Solr 5.3

Pre Solr 5.3 you would need to execute the following steps to extract the necessary JAR files for the operation:

  1. Find the lucene-core and lucene-misc JAR files 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). These two JAR files should be in WEB-INF/lib. They are named lucene-core-VERSION.jar and lucene-misc-VERSION.jar.
  2. Copy them somewhere easy to find and use that path instead of the path mentioned in the command below.
  1. Make sure that both indexes you want to merge are closed.
  2. Issue this command:

    This will create a new index at /path/to/newindex that contains both index1 and index2.

  3. Copy this new directory to the location of your application's solr index (move the old one aside first, of course) and start Solr.

    For example:

Using CoreAdmin

The MERGEINDEXES command of the CoreAdminHandler can be used to merge indexes into a new core – either from one or more arbitrary indexDir directories or by merging from one or more existing srcCore core names.

See the CoreAdminHandler section for details.


  • No labels