hubmapconsortium / search-api

HuBMAP search service and associated pieces to create an index
https://search.api.hubmapconsortium.org
MIT License
2 stars 2 forks source link

reindex-all script - "swap" the newly filled indices to be active #856

Closed kburke closed 4 weeks ago

kburke commented 2 months ago

The scripts/fresh-indices/fresh-indices.sh script currently supports a create command which creates a new ElasticSearch index with a time-stamped name, and fills it documents created using current Neo4j data. search-api/issues/855 will allow the index to be further updated with post-create data until up-to-date with Neo4j.

Existing functionality in the ESManager class supports ElasticSearch operations which are not related to document CRUD. Use this functionality to implement a new command supported by fresh-indices.sh with a name like swap, maybe go-live, etc.

This command should rename the current active index to something so it is possible to restore it, should rename the newly created index to the name of the active index in search-api's search-config.yaml, and wait for the indices to have "green" health. E.g.

The existing "log-indexing-oss" process, from which "fresh-indices" code was derived, does something very similar to this already, after creating and filling.