Search code examples
javasolrsolrjsolrcloud

Solr Unique key update in cloud mode


Is it possible to modify type of unique key without dropping collection in solr cloud mode? or is it possible create new unique key?


Solution

  • You cannot modify the unique key without re-indexing or dropping the collection in solr cloud.

    I would suggest the alternative option where you don't need to drop the collection.

    Here you update the schema with appropriate type for your unique key and upload the schema through zookeeper.

    Then you can reload the data..it is as good as re-indexing the collection.

    A better alternative would be to create another collection with modified schema. Create an alias to the new collection(Alias should have the same name as earlier collection).

    Make sure all the new requests are re-directed to the new collection with the help of alias name.

    Then drop the older collection.