Schema Field Types
Search fields must follow specific types. Types indicate the type of data that is intended to be stored in the field.
Available field types
The currently avaiable field types are text, facet, i64, u64, f64, datetime and bool. Any field type may be used for filtering but facet
fields differ in that they have a hierarchy and produce facet counts.
Field type configuration options
Every field may be used for either searching or just as display fields within search results. You may also choose not to display a field and only use it for indexing purposes.
text
A text field that may be analyzed and split into tokens before indexing. Used for full text searching or to store display only data that is not indexed.
Configuration Property | Description | Default value |
---|---|---|
stored | Whether or not the value is retained in the document store | true |
indexed | Determines if the values are indexed | true |
multi | Determines if the field contains a single value or an array of values | false |
facet
A facet field. Values are expected to be in the format of “/section/subsection” (multiple levels of depth are optional). Think of this as a taxonomical hierarchy field that can be walked down. Search results will include a count of documents that match the facet.
Configuration Property | Description | Default value |
---|---|---|
stored | Whether or not the value is retained in the document store | true |
multi | Determines if the field contains a single value or an array of values | false |
Note: facet fields are always indexed.
bool
A boolean field. true
or false
values without quotes.
Configuration Property | Description | Default value |
---|---|---|
stored | Whether or not the value is retained in the document store | true |
indexed | Determines if the values are indexed | true |
fast | Store the value in a fast field | true |
required | Is the field required? | false |
i64
A 64 bit signed integer field. Signed integers are used for representing negative numbers. If you aren’t using negative values, use a u64 integer instead. Examples: 3
, -1.0
, -200
, 42
Configuration Property | Description | Default value |
---|---|---|
stored | Whether or not the value is retained in the document store | true |
indexed | Determines if the values are indexed | true |
fast | Store the value in a fast field | true |
required | Is the field required? | false |
u64
A 64 bit unsigned integer field. Unsigned integers are used for representing values that contain positive, whole numbers only. Examples: 5
, 42
Configuration Property | Description | Default value |
---|---|---|
stored | Whether or not the value is retained in the document store | true |
indexed | Determines if the values are indexed | true |
fast | Store the value in a fast field | true |
required | Is the field required? | false |
f64
A 64 bit floating point number field. Floating point numbers are used for representing decimal values. Examples: 3.6
, 2.0
Configuration Property | Description | Default value |
---|---|---|
stored | Whether or not the value is retained in the document store | true |
indexed | Determines if the values are indexed | true |
fast | Store the value in a fast field | true |
required | Is the field required? | false |
datetime
A 64 bit floating point number field. The datetime type handles dates and datetimes. Since JSON doesn’t have a date type, the datetime field support multiple input types and formats. Values can be in the in the format of integer numbers representing a Unix timestamp or strings containing a rfc3339
formatted date or Unix timestamp. Examples: 2024-07-16T00:25:39Z1
, 1736197316
Configuration Property | Description | Default value |
---|---|---|
stored | Whether or not the value is retained in the document store | true |
indexed | Determines if the values are indexed | true |
fast | Store the value in a fast field | true |
required | Is the field required? | false |
Fast Fields for Numeric, Datetime and Bool types
Numeric, datetime and bool values can be stored in a fast scoring field which is a column-oriented storage used for range queries and aggregations. For those familiar with Lucene, this is similar to DocValues. There is a trade-off of speed vs. accuracy when using fast scoring fields.
If you want to be able to order by a field it must be configured as a fast field.
For number fields you typically always want fast
enabled unless you know what this does. The fast attribute is not used on text fields or facet fields.
Fast fields are not recommended for multi-value fields as only the last value is retained
Additional Types
Additional types are planned to be supported in the future such as nested JSON values, IP addresses, and geospatial. Additional format options for datetime are also planned to be supported.