Search code examples
apachesolrsolrjsolrcloudsolr4

Merging SOLR core in two different servers


Is it possible to merge cores present in two different solr servers?
For example , I have core A and core B in SOLR 1 and I want to merge core A and core B to core C which is present in SOLR 2 . Is this possible by some means ?

SOLR 1 - (core A, core B).

SOLR 2 - (core C)

Basically I am trying to merge core A and B into core C .


Solution

  • You can use the DataImportHandler with the SolrEntityProcessor. It's kind-of-hidden away, but is documented in the old community wiki. I have no idea if this will be performant for larger cores and for a larger number of documents, so be aware of the possible limitations.

    Another option is to use replication to get Core A and Core B onto Solr 2, then use the regular CoreAdmin and MERGEINDEXES to merge everything to a single core. This will probably be more performant and can handle way larger datasets.

    The third option is to write a small utility and use the export interface to export content from your first two servers and index it into the third one. This will be the most flexible approach.