Elasticsearch Alias, allows me to re-index without disconnecting the clients.
For example, I have an e-commerce that connects directly to elasticsearch.
I use hibernate-search in my erp to index my records from the database (100000 records).
But when doing reindex, hibernate-search deletes the records and inserts them again.
It would be cool to have a unique option to recreate the data in another index and after it has finished pointing to the alias. Allowing zero downtime.
Example:
On create: 1- my_index(alias) --- > my_index_v1 2- add new records (100000 records) in my_index_v1
On update (reindex): 1- my_index(alias) --- > my_index_v1 2- add new records (100000 records) in my_index_v2 3 - change my_index(alias) --- > my_index_v2 4 - remove and delete my_index_v1
In the documentation says this:
{panel:title=value:update} The index, its mappings and analyzer definitions will be created, existing mappings will be updated if there are no conflicts. Caution: if analyzer definitions have to be updated, the index will be closed automatically during the update. {panel}
Maybe a property like this:
{code:java} <property name="hibernate.search.default.elasticsearch.index_schema_management_strategy" value="update-with-alias"/> <property name="hibernate.search.default.elasticsearch.create_index_on_startup" value="true"/> {code}
Index Aliases (Guide): https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
Index Aliases and Zero Downtime (Reference): https://www.elastic.co/guide/en/elasticsearch/guide/current/index-aliases.html |
|