rhsimplex / image-match

🎇 Quickly search over billions of images
2.94k stars 405 forks source link

How do I clear the image index so I can add another set of images? #108

Closed bhavikshah1995 closed 5 years ago

bhavikshah1995 commented 5 years ago

I'd like to avoid redundancy of the same images appearing multiple times upon matching. Is there any way we can remove images, or completely empty the image index?

Edit: As of now I'm having to use Curl to XDELETE the elasticsearch localhost, and load all images again, as this seems to be an elasticsearch related issue. I'd still be glad if some functionality to remove images from index were introduced, or if they already do, be added to the documentation.

taylorjdawson commented 5 years ago

@bhavikshah1995 since you have the elasticsearch instance right in your code you can do this:

INDEX_NAME = 'images'
es = Elasticsearch()
es.indices.delete(INDEX_NAME)

See this line

bhavikshah1995 commented 5 years ago

@taylorjdawson That works well, thank you!