#community-help

Merging Typesense Search Results in JS

TLDR Steffen asked for recommendations on merging Typesense search results with local JS results. Jason suggested a few browser-based search libraries, including fuse.js. Steffen agreed that merging is complicated, but will consider a combined ranking strategy.

Powered by Struct AI
4
12mo
Solved
Join the chat
Oct 19, 2022 (12 months ago)
Steffen
Photo of md5-9873c8bd4a02ffd0be1123516cd2cd4b
Steffen
02:37 PM
Hi everybody,
does anybody have recommendations on how to merge search results coming from Typesense with local results in JS? Any browser search library that at least somehow maps the behavior of Typesense?
Thanks a lot 🙏
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:31 PM
There are libraries like fuse.js, lunr.js, elasticlunr, stork search, etc that are browser-based search libraries…
03:32
Jason
03:32 PM
But I’m not sure about merging search results, because each library engine has its own relevance mechanisms, so it would hard to order results from different engines into one linear list
Oct 20, 2022 (12 months ago)
Steffen
Photo of md5-9873c8bd4a02ffd0be1123516cd2cd4b
Steffen
07:56 AM
Thanks Jason. Yeah, I’m experimenting with them but merging is really complicated, agree. And if you wrap your typesense results you always get worse results. Maybe a combined ranking based on the matches both engines create might work. I’ll figure something out. Thanks for your thoughts though!