Indexes definition
Index definitions are a property of the Collection document definition.
The following is a generalized Index definition:
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 ...
}
The following table describes the indexes
fields.
You can define any number of indexes and the name of an Index is its
<indexName>
. A defined Index requires that at least one term
or one
value
to also 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 status:
The index build process executes asynchronously so indexes can’t be built or
rebuilt instantaneously. The |
|
|
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!