on-internet
← Community

Why adding a term filter on a text field return no hits in my PolarSearch k-NN query?

Stack Overflow ·

I am using PolarSearch and want to run a k-NN vector search with a filter. The index is built as follow. PUT test_index { "settings": { "index": { "knn": true } }, "mappings": { "properties": { "category": { "type": "text" }, "embedding": { "type": "knn_vector", "dimension": 2, "method": { "name": "hnsw", "engine": "faiss", "space_type": "l2" } } } } } After that, I wrote one document: PUT /test_index/_doc/1 { "category": "Soft Drink", "embedding": [1.0, 1.0] } The following query is normal and returns the data I have added: POST /test_index/_search { "size": 2, "query": { "knn": { "embedding"

Comments

Sign in or sign up to comment and upvote.

No comments yet.