Description
Normal query
SELECT c.Car, c.ColorFROM store sJOIN car c ON c.Car = "Bentley" and c.Color like "%blue%" AND "Bentley" IN s.AvailableCars |
This shows all cars which are of blue color
[ { "Car": "Bentley", "Color": "dull blue" }, { "Car": "Bentley", "Color": "pastel blue" }, { "Car": "Bentley", "Color": "very dark blue" }, { "Car": "Bentley", "Color": "water blue" }] |
Now instead of c.Color like "%blue%" I try out a vector query I am getting all sorts of color except the blue
Query:
SELECT c.Car, c.ColorFROM store sJOIN car c ON c.Car = "Bentley" AND "Bentley" IN s.AvailableCarsandSEARCH(c, { "query": { "match_none": {} }, "knn": [{ "field": "color_rgb_vector", "vector": [0,0,255], "k": 3 }]}) |
[ { "Car": "Bentley", "Color": "lighter green" }, { "Car": "Bentley", "Color": "dusky rose" }, { "Car": "Bentley", "Color": "dull blue" }, { "Car": "Bentley", "Color": "dark plum" }, { "Car": "Bentley", "Color": "deep lavender" }, { "Car": "Bentley", "Color": "grey pink" }, { "Car": "Bentley", "Color": "orange yellow" }, |
Now one reason could be that the embedding model could say that the closest color to blue are these returned colors but thats not the case because
{ "query":{ "match_none":{ } }, "explain":true, "knn":[{ "field":"color_rgb_vector", "k":2, "vector": [0,0,255] }] } |
|
Returns
|
"Color": "rich blue" |
"Color": "vivid blue", |
"Color": "light royal blue", |
Attachments
Issue Links
- relates to
-
MB-61542 With no qualifying search index SEARCH() function for vector queries resulting in random results
- Closed