Simple alternative reindexing tool#103
Conversation
annotator/elasticsearch.py
Outdated
There was a problem hiding this comment.
SyntaxError here. Missing an intended +?
|
So the entire point of this is just to add the mapping merge to what the python package already provides? from elasticsearch import Elasticsearch, helpers
conn = Elasticsearch()
helpers.reindex(conn, 'annotator', 'annotator_new')There's no need to provide special wrapping around copying the mapping over. Modify the .cfg and start the server and it puts the mapping itself. Then reindex. This is why I've been so confused why everyone seems to think we need a reindexing script. I do this every time we update the mapping and it took me only a few minutes to figure out the first time, without documentation. |
|
Hey, @Treora, let's do this. How about we combine this with the other PR. Put it all in run.py. Just use the imports straight from
The host and index ( Basic usage would be
and then updating the cfg. With aliases,
and we run the reindex twice, once before and once after updating People can start with an index, change it if they want and update their config, or move to using aliases and then just name the new db each time. Slap on a What say you? |
If you prefer not adding unnecessary scripting, this strips it down to a minimum that just puts the right mapping in place. The doc provides an example for using it and tells how to delete an index or alias and create a new alias.