I found a behaviour change and want to check in, i...
# community-help
n
I found a behaviour change and want to check in, if it is a bug. we using v30.1rc7 When doing a normal search and query_by on 1 or multiple normal fields, The result parameter "found" indicates number of matching documents (right?) But when doing semantic search and we query only on "embedding" it seems that "found" is always equal "per_page". So if i do { "searches": [ { "q": "whatever here", "query_by": "embedding", "collection": "[collection]", "prefix": "false", "per_page":11, //<------------------ "page":1 } ] } i get 11 hits if query with "per_page":11 and "page":2 => i get "found": 22 if query with "per_page":11 and "page":3 => i get "found": 33 if query with "per_page":11 and "page":4 => i get "found": 44 is this a bug?
a
Hey @Nicholas Tjørnelund, sorry for the wait here. Not a bug and not a change in v30.1rc7. It is the intended (and long-standing) behavior of pure vector search in Typesense. Pure vector search has no notion of a "total match count", so
found
reflects how many nearest neighbors HNSW was asked to return, and that number defaults to
page * per_page
. To fix pass an explicit
k
via
vector_query
, e.g.
vector_query: "embedding:([], k: 200)"
.
n
okay thanks!