DocumentDB Vector Search with Filtering

0

Hi all, is it possible to do DocumentDB Vector Search with Filtering?

query = { "$search": { "vectorSearch": { "vector": [0.2, 0.6, 0.9], "path": 'vectorEmbedding', "similarity": 'euclidean', "k": 2, "efSearch": 40, 'filter': { '$and': [ { 'price': { '$gt': 20 }, 'price': { '$lt': 50 } } ] }, } } }

results = test_collection.aggregate([query])

for result in results: print(result)

It resulted in this error: OperationFailure: BSON field '$search.vectorSearch.filter' is an unknown field., full error: {'ok': 0.0, 'code': 40415, 'errmsg': "BSON field '$search.vectorSearch.filter' is an unknown field.", 'operationTime': Timestamp(1714105218, 1)}

wyseow
asked 16 days ago24 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions