Thank you for the help with v4 syntax. It works but response has objects no matter what I query. For an example, if I query non-existing text such as “abcaslkhas”, it returns objects.
Do I need to add any additional attributes to the query so that it returns objects ony if the query string exists?
Thanks.
So the Near Text operator is to find objects with the nearest vector to an input text.
Indeed you could insert some unrelated text and still retrieve an object because it vectorize the query input and it tries to find ‘ANN’ approximate nearest neighbor for vector-search queries.
The following operator can explain the distance in such search and shall return a far distance value:
_additional {
distance
}
See here:
However from what I understood you are trying to achieve, then I would highly recommend you → Hybrid Search which is the key to your case because Hybrid search results can favor the keyword component, the vector component or mix of both.
Use alpha operator of 1 is a pure vector search or;
An alpha of 0 is a pure keyword search or;
Play with the value to lean more towards keyword or vector component!