Indexes can be configured on one or more fields in order to improve speed of data retrieval, or defining uniqueness.
Note that for setting a single field as unique, use the
method on the field builder as follows:
Indexes can be configured on composition of fields and edges. The main use-case is setting uniqueness on fields under a specific relation. Let's take an example:
In the example above, we have a
City with many
Streets, and we want to set the
street name to be unique under each city.
The full example exists in GitHub.
Indexes currently support only SQL dialects, and do not support Gremlin.