Is there a way to search by already indexed document?

It is a pretty common use case. Let’s say I have a collection of oil paintings. Each one has been indexed already. When user opens one painting, I want to find out similar paintings that might be of interest for the user. Since the current one has already been indexed, it is a waste to resubmit the image url for downloading and preprocessing, as per the api in documentation:

results = mq.index("my-multimodal-index").search('')

Is there an api to search by already indexed entries to find out similar ones?


Hi, searching directly with an already indexed document is not yet supported. However, you could do it another way which is to get the document and its vector and then search using that vector as context.

document = mq.index("my-first-index").get_document("<document_id>", expose_facets=True)

vector = document['_tensor_facets'][0]['_embedding']

results = mq.index("my-first-index").search(
    {"" :0},
    context = {"tensor": [{"vector": vector, "weight" : 1}]}