The combined index type and syntax type is called the index strategy. To specify an index, you declare it using a string that specifies your index strategy.
This string is formatted as follows:
[unique]-{path type}-{node type}-{key type}-{syntax type}-
unique is the actual value that you provide in this position on the
string. If you provide this value, then indexed values must be
unique. If you do not want indexed values to be unique, provide
nothing for this position in the string.
See Uniqueness for more information.
-
{path type} identifies the path type. Valid values are:
- node
- edge
See Path Types for more information.
-
{node type} identifies the type of node
being indexed. Valid values are:
- element
- attribute
- metadata
If metadata is specified, then {path type} must be node. See Node Types for more information.
- {key type} identifies the sort of
test that the index supports. The following key types are supported:
- presence
- equality
- substring
See Key Types for more information.
- {syntax type} identifies the syntax
to use for the indexed value. Specify one of the following values:
- AnySimpleType
- AnyUri
- Base64Binary
- Binary
- Boolean
- Date
- DateTime
- DaytimeDuration
- Decimal
- Double
- Duration
- Float
- GDay
- GMonth
- GYear
- GYearMonth
- HexBinary
- Node
- None
- Notation
- QName
- String
- Time
- UntypedAtomic
- YearMonthDuration
The following are some example index strategies:
- node-element-presence-none
- unique-node-metadata-equality-string
- edge-attribute-equality-float
Also, be aware that you can specify multiple indices at a time by providing a space-separated (or comma-separated)list of index strategies in the string. For example, you can specify two index strategies at a time using:
node-element-presence-none edge-attribute-equality-float