#community-help

Redesigning Global Search Using Typesense: Single or Multiple Documents?

TLDR satish queries about the best typesense document structure for global search. Jason advises using multiple collections and multi-search, assuring it's more efficient but suggests benchmarking with their data.

Powered by Struct AI
6
19mo
Solved
Join the chat
Apr 04, 2022 (19 months ago)
satish
Photo of md5-21068ce5c0a7db9d103fad551dbefbc7
satish
04:09 PM
We are prototyping the type sense for global search for the internal product which was using SQL server. We have search across 4 different domain entities like device, user application and content . We have a single text box when entered we are searching across all the tables to get the details .

Now we are planning to redesign it using typesense. What is the best way to design the document structure. Is de normalise better or have multiple documents and do multi search
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:11 PM
If you need to visually show your users that these results are from Entity X and these other results are from another Entity Y, then you want to put them in separate collections and do a multi-search.
satish
Photo of md5-21068ce5c0a7db9d103fad551dbefbc7
satish
04:36 PM
Will that having a scaling issue in terms of response time?
04:37
satish
04:37 PM
Since Instead of search on one index I might search on 4 now
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:45 PM
Sending multiple searches in a single search multi_search request has less overhead, and fanning out searches across multiple collections is actually more performant
04:46
Jason
04:46 PM
But I would recommend benchmarking with your particular dataset to asses how it works for you