#community-help

Creating Document with Undefined Schema Fields

TLDR Matthias questioned how they can create a document with undefined schema fields. Jason explained it's by design and suggested using include_fields and exclude_fields to control returned fields.

Powered by Struct AI
Sep 16, 2021 (28 months ago)
Matthias
Photo of md5-8ac455f6d302407f03def4c775778b28
Matthias
09:45 PM
Why can I create a document with field that are not defined by the schema? There is no error and and I didn't add any wildcard fields.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:46 PM
That's by design. Fields that don't exist in the schema are not indexed. They're just stored on disk and returned if a document is a hit
09:46
Jason
09:46 PM
You can control which fields are returned using the include_fields and exclude_fields search param