#community-help

Discussing Schema Design Best Practices and Splitting Collections

TLDR Janaka inquired about resources for schema design and collection splitting. Kishore Nallan advised that splitting should occur for distinct entities and recommended client-side merging and sorting using text match score.

Powered by Struct AI

1

Sep 21, 2021 (28 months ago)
Janaka
Photo of md5-3ecfadbfb82a962691e2d6cb42f876b4
Janaka
12:01 PM
Hi 👋 - are there any resources on schema design best practices anybody can point me at? I've looked through the docs and Googled. I'm trying to understand when it's best to split different types of content into separate collections. I've tried splitting and realised that multi-search returns results for each collection separately. In my case (Zettle-Kasten notes and Kindle book highlights) the content seems closely related enough that ranking across seems to make sense i.e. I want the most relevant hits across both collections. Thanks in advance for any tips and 🙏 for creating Typesense, I've only just started using but fits my needs really well and awesome to work with so far.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:04 PM
👋 The text match score associated on the result documents in a particular collection can actually be compared with results from another collection. So even though the results are returned separately, if you wish, you can merge and sort them client side based on the value of the text match score.
12:04
Kishore Nallan
12:04 PM
Usually splitting is done only when the collections are of different entities entirely, for e.g. books vs authors vs publishers. Otherwise, you can probably use a field to differentiate records of different kinds.
Janaka
Photo of md5-3ecfadbfb82a962691e2d6cb42f876b4
Janaka
02:53 PM
Thanks Kishore that's really helpful to know about the text_match score and your confirmed my hunch on when to split and not. 🙏:skin-tone-5:

1