Slackbot
09/12/2023, 3:47 PMAnish V
09/12/2023, 3:48 PM'query_by': 'embedding,description'Jason Bosco
09/12/2023, 3:59 PMJason Bosco
09/12/2023, 3:59 PM➜ ~ curl -s 'https://qtg5aekc2iosjh93p.a1.typesense.net/multi_search?x-typesense-api-key=8hLCPSQTYcBuK29zY5q6Xhin7ONxHy99' \
-X 'POST' \
--data-binary '
{
"searches": [
{
"query_by": "embedding",
"vector_query": "embedding:([], distance_threshold:0.50, k:10)",
"collection": "hn-comments",
"q": "cinema"
}
]
}
' | jq '.results[0].hits[].vector_distance'
0.35301458835601807
0.3530757427215576
0.37170201539993286
0.37984395027160645
0.39115262031555176
0.4030781388282776
0.4054117798805237
0.410835325717926
0.41370344161987305
0.4149748682975769Jason Bosco
09/12/2023, 4:00 PMAnish V
09/12/2023, 4:06 PM"query_by": "embedding",, but as soon I add another field there the vector distance isn't respected.Anish V
09/12/2023, 4:07 PMJason Bosco
09/12/2023, 4:07 PM➜ ~ curl -s 'https://qtg5aekc2iosjh93p.a1.typesense.net/multi_search?x-typesense-api-key=8hLCPSQTYcBuK29zY5q6Xhin7ONxHy99' \
-X 'POST' \
--data-binary '
{
"searches": [
{
"query_by": "text,embedding",
"vector_query": "embedding:([], distance_threshold:0.50, k:10)",
"collection": "hn-comments",
"q": "cinema"
}
]
}
' | jq '.results[0].hits[].vector_distance'
2
2
0.35301458835601807
2
2
0.3530757427215576
2
0.37170201539993286
2
2Jason Bosco
09/12/2023, 4:08 PMvector_distance field is being set to 2 for all the results that are because of keyword search.Jason Bosco
09/12/2023, 4:09 PMvector_distance is only calculated for results that were pulled up from a vector search and distance threshold only applies to vector search.Jason Bosco
09/12/2023, 4:10 PMvector_distance: 2 for keyword-matched results, when technically we should not be returning that field at allAnish V
09/12/2023, 4:11 PMJason Bosco
09/12/2023, 4:12 PM