Skip to content

Simple alternative reindexing tool#103

Closed
Treora wants to merge 1 commit intoopenannotation:masterfrom
Treora:reindex_simple
Closed

Simple alternative reindexing tool#103
Treora wants to merge 1 commit intoopenannotation:masterfrom
Treora:reindex_simple

Conversation

@Treora
Copy link
Copy Markdown
Contributor

@Treora Treora commented Oct 2, 2014

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SyntaxError here. Missing an intended +?

@tilgovi
Copy link
Copy Markdown
Member

tilgovi commented Oct 3, 2014

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.

@tilgovi
Copy link
Copy Markdown
Member

tilgovi commented Oct 3, 2014

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 annotator like it's done there now.

./run.py annotator.cfg --reindex new [--alias]

The host and index (old) are taken from the config, and we don't need worry about the fact that old could already be an alias.

Basic usage would be

./run.py annotator.cfg --reindex annotator-store-new

and then updating the cfg.

With aliases,

./run.py annotator.cfg --reindex new --alias

and we run the reindex twice, once before and once after updating old to alias new (assuming it was already).

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 --delete-old if you want, but if you want to resolve the aliases first and then clean up after them.

What say you?

@Treora Treora deleted the reindex_simple branch October 7, 2014 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants