Alihossein shahabi
Alihossein shahabi

Reputation: 4362

move some of documents from one collection to another collection in Solr

I have one collection and I want to move some of it's to another collection.

For example, I have a lot of documents in collection A and I want to move all 1 month older documents to collection B (these 1 month older documents should not be in collection A).

I using Python for this job. How can I control the documents that are removed from Collection A transferred to Collection B? And the documentary has not gone away?

one solution that I know is:

Do you know another solution?? how can I make sure documents are deleted from Collection A, only if Collection B has been inserted successfully

Upvotes: 0

Views: 305

Answers (1)

Persimmonium
Persimmonium

Reputation: 15789

To me this sounds a much better way (as long as all fields as stored):

  1. use DIH with SolrEntityProcessor to index the desired docs into the new collection
  2. use delete by query to delete the docs

Of course you can verify the number of docs match by issues searches to the new collection and to the current one (instead of the delete)

Upvotes: 1

Related Questions