Indexes definition
An index definition is the indexes property of the Collection document definition with the following generalized structure:
indexes: {
<indexName>: {
terms: [
{
field: "<fieldName>",
mva: true | false
},
... more terms ...
],
values: [
{
field: "<fieldName>",
order: asc | desc
mva: true | false
},
... more values ...
],
queryable: <boolean>,
status: <literal>
},
... more indexes ...
}
You can define any number of indexes for a collection in the indexes field
and indexes are differentiated by their <indexName>. An index can have the
following fields and requires that at least one term
field or one value
field be defined.
Property | Optional | Type | Writeable | Description |
---|---|---|---|---|
|
Yes |
Yes |
Term definition list. A term defines exact match criteria. See |
|
|
Yes |
Yes |
Value definition list. A value describes a discrete or range value to
match on. See |
|
|
Yes |
No |
Index build status:
The index build process executes asynchronously so indexes can’t be built or rebuilt instantaneously. |
|
|
Yes |
Yes |
Index query status:
|
terms
Terms are an Array of zero or more field definitions for document
values that are used for equality comparisons during a search.
If a given document doesn’t have values defined for all the terms
,
no index entry is created for that document.
The following document field types can be indexed as terms:
Properties
Field | Type | Required | Description |
---|---|---|---|
|
Yes |
The document field path to use for searching. Dot notation is accepted. |
|
|
No |
Multivalued attribute flag. This field is returned only if it is set by the
user to
|
Access nested terms
fields using
dot notation.
values
Values are an Array of zero or more field definitions for document values that are used to order results from indexes.
When values are defined for the index, all documents are indexed including those that have a null value for the field.
Properties
Field | Type | Required | Description |
---|---|---|---|
|
Yes |
The document field path to use for searching. Dot notation is accepted. |
|
|
No |
The sort order for this field:
|
|
|
No |
Multivalued attribute flag:
|
Access nested values
fields using
dot notation.
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!