Add method to remove images from index
Please can you add a method to remove an image from the index, I would like to keep the index up-to-date with my list of images (which is constantly changing).
Hey @walidsa3d
Should be easy to implement, see https://github.com/pavlovai/match/blob/master/src/match/server.py#L43
Page not found - Could you please reiterate how to remove images from the index, and also possible functions I can use with ses?
#108
#108 would delete an entire index I think @walidsa3d want's to delete a single image.
I also think this is out of the scope of image-match. Adding and searching images need wrappers since it deals with the signature algorithm.
Try this:
from elasticsearch import Elasticsearch
es = Elasticsearch()
IMAGE_NAME = 'my_awesome_image.jpg'
query = f'path:"{IMAGE_NAME}"'
es.delete_by_query(index='images', doc_type='image', body={}, q=query)
The doc_type and index parameters are set by image-match here.
Additionally, I set the body param to an empty object as the method requires it but I am using the uri search query instead of using the body.
Resources: Using Elasticsearch's delete by query elasticsearch-py's method delete_by_query