Dark Mode

Creating indexes

Prerequisites

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:

ArgumentDefaultDescription
nameGeneratedCustom index name.
classSecondary indexCustom index class, such as SAI.
targetVALUESSpecifies set and list index type. Options are FULL and VALUES.
optionsN/AAny options to pass to the underlying index query.