pankaj
pankaj

Reputation: 1733

Replacing old indexed data with new data in Apache Solr with zero downtime

Requirement-

Replace old indexed data with new indexed data every night in Apache Solr. Until the new data is indexed completely, I want old data to be searched for this duration. And when new data indexing is completed, then there should be switching logic, that will point the searching to new data in no time. After this old data should be deleted.

Is there a switching concept in Apache Solr which handle this scenario?

There are 100 000 documents which need to be indexed.

Upvotes: 0

Views: 516

Answers (1)

Persimmonium
Persimmonium

Reputation: 15771

there is: Aliases.

  • Your app should hit solr via aliases, not hitting real collection directly
  • You build a new collection while the old one is being used
  • After it is built, you change the alias to point to the new collection, no downtime
  • you delete the old collection (if you want).

The above is if you are using SolrCloud. If you are not, you can do a similar thing with the Core api

Upvotes: 4

Related Questions