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

DeleteById will delete index if id parameter is null #37

Closed
jamiegaines opened this issue May 24, 2012 · 2 comments
Closed

DeleteById will delete index if id parameter is null #37

jamiegaines opened this issue May 24, 2012 · 2 comments

Comments

@jamiegaines
Copy link

The ElasticClient.DeleteById(string index, string type, string id) overload will delete the entire index if id happens to be null.

I'm not sure if this is desired behavior or not, but it might be nice to have a ThrowIfNull inside the method.

I'm using NEST in a windows service and saw my whole index of 190k documents wiped out because of a data bug on my part.

Yes, I should have checked for a null id value before calling the method. I admit it. :) But I was a bit surprised that NEST just deleted the whole index because of my oversight.

I love the product. Keep up the great work.

@Mpdreamz
Copy link
Member

Yikes, this is a big one! The oversight is entirely on my end. Will jump on this tomorrow morning and add some tests on all the delete calls for null refs.
Thanks for being understanding :)

@Mpdreamz Mpdreamz mentioned this issue May 28, 2012
@Mpdreamz
Copy link
Member

Pushed a fix + test for this, but sadly referenced the wrong issue in the commit message :)

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

2 participants