Creating indexes
Prerequisites
- Get an application token.
- Create a keyspace using the DataStax Astra DB dashboard.
Use the application token you generatedto create schema in your keyspace using the GraphQL playground.
Cassandra supports indexing any regular, non-primary key fields in an object type.Any field designated as a partition key or clustering column cannot be indexed,unless DataStax Enterprise is the defined database.A field will be indexed if `@cql_index` is added to the field definition.Indexed fields can be used as parameters in queries.
The directive `@cql_index` has the following optional arguments:
Argument | Default | Description |
name | Generated | Custom index name. |
class | Secondary index | Custom index class, such as SAI. |
target | VALUES | Specifies set and list index type. Options are FULL and VALUES. |
options | N/A | Any options to pass to the underlying index query. |