#community-help

Storing Non-Indexed Document Fields in Typesense

TLDR Thomas asked about unindexed, stored fields. Jason explained that unindexed fields can be stored and returned if the document is a match. Andrew added a limitation about nested fields.

Powered by Struct AI

3

2

1

1

10
20mo
Solved
Join the chat
Feb 23, 2022 (20 months ago)
Thomas
Photo of md5-364d4bd42c5fa7cc676d57e1c52abbbc
Thomas
05:19 PM
Is it possible to have document fields that aren't indexed, but still stored on typesense?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:20 PM
Yup, you can just leave fields out of the schema definition when creating the collection, and then send any additional fields when importing documents
05:21
Jason
05:21 PM
Only fields mentioned in the schema are indexed in memory. Others are stored on disk and returned if the document is a match

1

05:22
Jason
05:22 PM
Also, these additional non-indexed fields can be nested btw if needed
05:22
Jason
05:22 PM
Only indexed fields have the nested limitation
Thomas
Photo of md5-364d4bd42c5fa7cc676d57e1c52abbbc
Thomas
05:22 PM
Perfect!!
Andrew
Photo of md5-88d88db4789daa0e3abef8c3ca27772b
Andrew
05:56 PM
There's one thing I'd like to add if you're planning to have nested fields: the include/exclude feature only works on the top level, so if you have
"data" : { "small": "foo", "big": "bar bar"} you can include or exclude "data" but not "data.small" or "data.big". This causes us a few problems, so I wanted to mention iz

2

1

05:59
Andrew
05:59 PM
(other than that, we totally love typesense!)

1

Thomas
Photo of md5-364d4bd42c5fa7cc676d57e1c52abbbc
Thomas
06:19 PM
Thanks for the warning!

1

06:19
Thomas
06:19 PM
We love it too, superb!

1