#community-help

Validity of Schema in Documentation

TLDR Harpreet raised doubt about a certain schema in the documentation. Kishore Nallan confirmed the error, and Harpreet planned to open a pull request to correct it.

Powered by Struct AI

1

May 26, 2021 (32 months ago)
Harpreet
Photo of md5-745d880d794220d9f0fb9ade17c6b861
Harpreet
05:42 AM
Can a schema contain a default_sorting_field which is not present in fields? Is this schema valid?
{
    "num_documents": 1250,
    "name": "ceos",
    "fields": [
      {"name": "company_name", "type": "string"},
      {"name": "full_name", "type": "string"},
      {"name": "from_year", "type": "int32"}
    ],
    "default_sorting_field": "num_employees"
  }

Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:42 AM
No that's not valid. Also, from v0.20, default sorting field is actually optional.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:43 AM
Copy paste error 🙂
Harpreet
Photo of md5-745d880d794220d9f0fb9ade17c6b861
Harpreet
05:44 AM
🙂
05:45
Harpreet
05:45 AM
from_year should be the value of default_sorting_field ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:45 AM
Yes
Harpreet
Photo of md5-745d880d794220d9f0fb9ade17c6b861
Harpreet
05:46 AM
Let me open a pr
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:46 AM
Thank you!

1

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community

Similar Threads