#community-help

Typesense Query for Related Documents in Ecommerce

TLDR Vlassis asked about finding related documents using a Typesense query. Jason suggested using vector search and recommended ML libraries for vector generation, with 'word2vec' for text content. Vlassis agreed to try it out.

Powered by Struct AI

1

16
14mo
Solved
Join the chat
Oct 17, 2022 (14 months ago)
Vlassis
Photo of md5-ca6495d5be926db80e09aabf066f4b8b
Vlassis
12:16 PM
Hey guys!

Is there any way to use a typesense query to find related documents?

For example in ecommerce, I would like to find related products based on some criteria like same category, same price range etc.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:59 PM
Vlassis In the most recent RC build of Typesense, we’ve added support for vector search. So you can generate embeddings using an ML model, store that in Typesense, and then query Typesense to do a “nearest neighbor” search to fetch related documents.
05:00
Jason
05:00 PM
Let me know if you’d be interested to try this out
Vlassis
Photo of md5-ca6495d5be926db80e09aabf066f4b8b
Vlassis
05:00 PM
Yes, very much!
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:01 PM
Cool, you want to use v0.24.0.rcn19 and then here are the instructions: https://gist.github.com/kishorenc/f008c3a60ee58cb084b0c33c0dbce148
Vlassis
Photo of md5-ca6495d5be926db80e09aabf066f4b8b
Vlassis
05:06 PM
So I need to use a 3d party tool yo generate the vectors?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:07 PM
Correct
05:07
Jason
05:07 PM
There are many OSS ML libraries that let you do this
Vlassis
Photo of md5-ca6495d5be926db80e09aabf066f4b8b
Vlassis
05:09 PM
I am using an offline recommender for my website
05:09
Vlassis
05:09 PM
I have to check with the developer is there is anyway I could combine it with typesense
05:10
Vlassis
05:10 PM
If*
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:12 PM
It looks like this provides a complete package to do end to end recommendations. Whereas in Typesense, we essentially offer a vector DB and the ability to do nearest neighbor search…
Vlassis
Photo of md5-ca6495d5be926db80e09aabf066f4b8b
Vlassis
05:14 PM
Yeah, it does not have search capabilities. I wonder if it can generate the vectors. Can you suggest me a library to check out?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:15 PM
word2vec is a popular one, if you have text content
Vlassis
Photo of md5-ca6495d5be926db80e09aabf066f4b8b
Vlassis
05:17 PM
Nice, it has a golang package too. I will try it and get back to you!

1