Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reindex #328

Closed
ThomasArdal opened this issue Aug 7, 2013 · 8 comments
Closed

Support reindex #328

ThomasArdal opened this issue Aug 7, 2013 · 8 comments

Comments

@ThomasArdal
Copy link

Other clients for ElasticSearch supports reindexing entire index as described here: http://www.elasticsearch.org/blog/changing-mapping-with-zero-downtime/#_reindexing_your_data

It would be cool to support this flow in NEST as well.

Mpdreamz added a commit that referenced this issue Aug 11, 2013
@Mpdreamz
Copy link
Member

@ThomasArdal
Copy link
Author

Looking sweet. I would be nice to be able to reindex with minimum number of parameters. Just reindex the current index to a new index ending up with the same name and the metadata from the mappings.

@Mpdreamz
Copy link
Member

Ahh just specifying FromIndex() and ToIndex() will do that, all the others are optional.

Also CreateIndex() is initialized from with the settings from the FromIndex() so you only need to specify to modifications you'd want instead of reapplying all the settings.

@ThomasArdal
Copy link
Author

Very nice. Great work!

@Mpdreamz
Copy link
Member

Ok i lied, in the 0.11.3.0 release Query() and CreateIndex() are mandatory. Just fixed this in the commit after the release with a unit to test that they are in fact optional. Will make it into the next release :)

@ThomasArdal
Copy link
Author

Cool!

@eamocanu
Copy link

I have a parent child index and calling reindex with object type throws a no documents exist in index exception: client.Reindex(...) -> exception
I have to reindex each type one after another; the problem becomes that if index already exist cannot use reindex() to insert other documents into it -> exception is thrown again.

Has anyone else found this behaviour?

@benbenwilde
Copy link

In my opinion, the NEST implementation of Reindex is too opinionated.

  1. You must create a new index during the reindex (can't just set it up yourself and then call re-index)
  2. You must setup all the settings and mappings during the reindex (you can't use your method of choice for these things, and the fluent interface is not as easy as alternative methods)
  3. The from-index must have documents

The current implementation may work for some, but for those who are looking for another way:
http://stackoverflow.com/a/34867857/2284031

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

No branches or pull requests

4 participants