#community-help

Multi-Index Search with Typesense Instantsearch Adapter

TLDR Ailish needed help with multi-index search using the Typesense instantsearch adapter. Kishore Nallan explained the server API separates these search requests, but can be merged using business logic. Jason suggested building custom widgets to do a multi-search request and aggregate scores on the client side.

Powered by Struct AI
7
20mo
Solved
Join the chat
Mar 21, 2022 (20 months ago)
Ailish
Photo of md5-7fcbf02da67845f42ef837fd8a989396
Ailish
12:03 PM
Hi all - looking for some advice or pointers. I’m building a federated search and using the typesense instantsearch adapter but from what I can see in the documentation, the only way do do a multi-index search when using the instantsearch adapter is to have the results display separately for each index, is that correct? What I’d like is to have all my results from all indices show up as one search ‘result’ with the ability to filter/facet etc on the whole dataset - is this possible?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:13 PM
Typesense server API itself separates the multi search requests. For e.g. if you are querying 3 different collections, the results for each collection is returned separately. You will have to merge this on the front end using your business logic.
Ailish
Photo of md5-7fcbf02da67845f42ef837fd8a989396
Ailish
12:22 PM
Thanks Kishore Nallan 🙂
12:27
Ailish
12:27 PM
do you know of any examples of this being done that I could look at Kishore Nallan?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:40 PM
Ailish From what I can tell, I don't believe this is possible to do with instantsearch, or at least not out of the box. So you might need to build your own custom widgets to do a multi-search request to Typesense and then aggregate the text match scores on the client side.
01:41
Jason
01:41 PM
We don't have an example of a custom widget like this, but I'd recommend checking if you can find any in the instantsearch repo or forums
Ailish
Photo of md5-7fcbf02da67845f42ef837fd8a989396
Ailish
06:56 PM
Thanks Jason I’ll look into it