description (optional) is intended for display in the Class Reference. The description is blank by default. See Creating Class Documentation in Defining and Using Classes.
name (required) is the name of the index. The name must follow property naming conventions and be unique within this class or table.
This name is used for database administrative purposes (reporting, index building, dropping indices, and so on). For information on property naming conventions, see Class Members. For information on the relationship between an index name in a class definition and the corresponding SQL index name, see CREATE INDEX in the InterSystems SQL Reference.
It is useful to follow a naming convention so that indices can be easily distinguished from properties. For example, you could include IDX at the end of all index names.
property_expression_list (required) specifies the property or properties on which the index is based and may also include a collation specification for each property. This option is either a single property expression or a comma-separated list of property expressions, enclosed in parentheses.
A given property expression consists of:
The name of the property to be indexed.
An optional (ELEMENTS) or (KEYS) expression, which provides a means of indexing on collection subvalues.
An optional collation expression.
For more details, see Define and Build Indexes in Defining a High-Performance Schema.
keyword_list (optional) is a comma-separated list of keywords that further define the index.
See Index Syntax and Keywords for a complete keyword list.
If this list is omitted, also omit the square brackets.
For example, the following class definition defines two properties and an index based on each of them: