Hi All, We are trying to do a vector embedding se...
# community-help
d
Hi All, We are trying to do a vector embedding search, and then return the search results based on a specific field. For example, sort by id in ascending order. Since vector search is a relevancy/distance search between the vector embeddings, that will not be possible in a straightforward way. It's maybe possible to set a threshold for the similarity and then do the sort up to that threshold, or set first n results and do the sorting based on that and return the page_size requested, but that would require a lot more steps in implementing, Is there an out of the box way using typesense that I can search by vector and then sort those results based on a scalar field?
j
You want to use a combination of distance_threshold and the k parameter:
k
parameter is documented here:https://typesense.org/docs/27.0/api/vector-search.html#nearest-neighbor-vector-search
distance_threshold
parameter is documented here: https://typesense.org/docs/27.0/api/vector-search.html#distance-threshold