#community-help

Typesense Product Search Using Euclidean Distance Between Vectors

TLDR mape asks about searching products in Typesense using Euclidean distance between vectors. Jason indicates this isn't yet supported and asks for an example from mape's use case.

Powered by Struct AI
Apr 20, 2021 (34 months ago)
mape
Photo of md5-5254d26c14eeb7bf240d5198f2c00e8e
mape
10:55 PM
Hi! I'm testing out typesense for a new project and was wondering if there is any way to search based on euclidean distance between vectors? I'm trying to enable search for products with similar colors.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
11:06 PM
Hi mape, we don't support this at the moment. Would what we've discussed in this issue, help your use case: https://github.com/typesense/typesense/issues/207
mape
Photo of md5-5254d26c14eeb7bf240d5198f2c00e8e
mape
11:34 PM
I'm not sure cosine similarity would be of use (based on some brief googling).

But "It is straightforward to fetch the nearest K results for a given search query vector, but that would just be just a search in the vector space" seem like it could be a good fit.

Has there been any progress on this? Something to test out?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
11:37 PM
No recent progress unfortunately, we had other things come up in preparation for v0.20.
11:37
Jason
11:37 PM
Could you add an example from your use case to that issue, so we have it for context?
mape
Photo of md5-5254d26c14eeb7bf240d5198f2c00e8e
mape
11:40 PM
Yup, absolutely