This message was deleted.
# community-help
s
This message was deleted.
a
I'm using
'query_by': 'embedding,description'
j
Hmm, that is indeed the way to do it...
I'm not able to reproduce the issue on a test dataset. For eg:
Copy code
➜  ~ 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.4149748682975769
Could you give me a curl snippet like this that creates a sample collection and documents, and reproduces the issue?
a
@Jason Bosco So actually it works fine with
"query_by": "embedding",
, but as soon I add another field there the vector distance isn't respected.
It's difficult to provide a curl snippet with the embeddings and everything, i can try and set up an example
j
Ah I see what you mean. For eg:
Copy code
➜  ~ 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
2
👍 1
In a hybrid search, the
vector_distance
field is being set to
2
for all the results that are because of keyword search.
Technically
vector_distance
is only calculated for results that were pulled up from a vector search and distance threshold only applies to vector search.
So the bug here is that we're returning
vector_distance: 2
for keyword-matched results, when technically we should not be returning that field at all
a
Is there a way to change the rank fusion formula (like not 0.7 keyword but lower)?
j
Not at the moment... Could you open a feature request GitHub issue for this?
👍 1