Search code examples
solrsolrcloud

Solr: move single document to another collection


I have system with user defined collections, in which the user can create and remove collections. For example the user has defined two collections named Germany and France to which domuments are manually add per the user's criteria.

Now I need to give the user the option to move a document (that was added, indexed and proccessed in the Germany collection) to the France collection.

I looked at the MIGRATE option in the Collections API, but it is not suited for user picked single documents.

A copy & delete could also work.

Is there any way to do this that I am missing?


Solution

  • How about you read the document from Germany collection and then add that to France and then once it is successfully added , just delete the doc from Germany collection.

    somehthing like this to delete the doc

    http://localhost:8983/solr/core_name/update?commit=true&stream.body=<delete><query>write query which can identify that single doc</query></delete>