mozilla / elasticutils

[deprecated] A friendly chainable ElasticSearch interface for python
http://elasticutils.rtfd.org
BSD 3-Clause "New" or "Revised" License
243 stars 76 forks source link

Don't make unindex_objects fail when trying to unindex an object that is not indexed #279

Open krs-wraus opened 9 years ago

krs-wraus commented 9 years ago

Right now, unindex_objects is very difficult to use since it will fail if any of the provided indexes are not present. This means that it can't be used without some kind of error checking, or looking up to see if the items to be unindexed are already in the index.

This can likely be fixed by using a try block and catching the NotFoundError so that it doesn't die immediately upon unindexing an object not in the index. Maybe make an optional argument to the function to ignore missing objects?