Hi Yoann Rodière, Thanks for the feedback. I thought of this feature so we could further eliminate the external manual process and allow that hibernate-search to manage this. But you're very right, this external process is needed anyway and making hibernate-search control this would not be good. A real example, is in my current development project with wildfly I am evaluating how to do a manual deployment, make blue-green for this. step 1 - In the first version in production my index will be called for example:
public static final String MY_INDEX_NAME="my_index_v1";
.....
@Indexed(index = myClass.MY_INDEX_NAME)
....
step 2 - I will index through a manual trigger;
fullTextEntityManager.createIndexer().startAndWait();
step 3 - I will create an alias manually for my_index;
POST /_aliases
{
"actions" : [
{ "add" : { "index" : "my_index_v1", "alias" : "my_index" } }
]
}
step 4 - When a new version is released with the changed mappings, filters and parsers, I'm going to change the name of my index manually for my_index_v2; Of course all this in a single Node.
public static final String MY_INDEX_NAME="my_index_v2";
step 5 - I will index through a manual trigger;
fullTextEntityManager.createIndexer().startAndWait();
POST _reindex
{
"source": {
"index": "my_index_v1"
},
"dest": {
"index": "my_index_v2"
}
}
step 6 - I make a blue-green of the index. I change manually the alias "my_index" to index "my_index_v2";
POST /_aliases
{
"actions": [
{ "remove": { "index": "my_index_v1", "alias": "my_index" }},
{ "add": { "index": "my_index_v2", "alias": "my_index" }}
]
}
step 7 - After everything is OK, I make blue-green with my load balancer, pointing to the new node. And so on in the next versions. I thought of doing this inside hibernate-search, but as you said, that responsibility should not be hibernate-search. Maybe we could provide an configuration option to add a suffix to every index, But I do not know if we really need it, it would be just a cherry on the cake. Regards. Leandro K. de Freitas |