List index metadata

This Astra DB Serverless feature is currently in public preview. Development is ongoing, and the features and functionality are subject to change. Astra DB Serverless, and the use of such, is subject to the DataStax Preview Terms.

The Data API tables commands are available through HTTP and the clients.

If you use a client, tables commands are available only in client versions 2.0-preview or later. For more information, see Data API client upgrade guide.

Gets information about the indexes associated with a specific table.

Method signature

  • Python

  • TypeScript

  • Java

  • curl

The following method belongs to the astrapy.table.Table class.

list_indexes(
  *,
  table_admin_timeout_ms: int,
  request_timeout_ms: int,
  timeout_ms: int,
) -> list[TableIndexDescriptor]

The following method belongs to the Table class.

async listIndexes(
  options?: {
    nameOnly?: boolean,
    timeout?: number | TimeoutDescriptor,
  }
): TableIndexDescriptor[]

The following methods belong to the com.datastax.astra.client.tables.Table class.

List<TableIndexDescriptor> listIndexes()
List<TableIndexDescriptor> listIndexes(ListIndexesOptions options)
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/ASTRA_DB_TABLE" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
  "listIndexes": {
    "options": {
      "explain": true
    }
  }
}'

Result

  • Python

  • TypeScript

  • Java

  • curl

Returns an unordered list of TableIndexDescriptor objects that describe each index in the table.

Example response:

[
  TableIndexDescriptor(
    name='m_vector_index',
    definition=TableVectorIndexDefinition(
      m_vector,
      options=TableVectorIndexOptions(metric=dot_product, source_model=other)
    )
  ),
  TableIndexDescriptor(
    name='winner_index',
    definition=TableIndexDefinition(
      winner,
      options=TableIndexOptions(
        ascii=False, normalize=True, case_sensitive=False
      )
    )
  ),
  TableIndexDescriptor(
    name='score_index',
    definition=TableIndexDefinition(
      score,
      options=TableIndexOptions()
    )
  )
]

Returns a promise that resolves to an unordered list of TableIndexDescriptor objects that describe each index in the table.

Example resolved response:

[
  {
    name: 'score_idx',
    definition: {
      column: 'score',
      options: {}
    }
  }, {
    name: 'winner_idx',
    definition: {
      column: 'winner',
      options: { ascii: false, caseSensitive: false, normalize: true }
    }
  }, {
    name: 'm_vector_idx',
    definition: {
      column: 'UNKNOWN',
      apiSupport: {
        createIndex: false,
        filter: false,
        cqlDefinition: 'CREATE CUSTOM INDEX m_vector_idx ON default_keyspace.games ("mVector")\n' +
          "USING 'StorageAttachedIndex'\n" +
          'WITH OPTIONS = {\n' +
          "    'similarity_function' : 'DOT_PRODUCT',\n" +
          "    'source_model' : 'OTHER'}"
      }
    }
  }
]

Returns an unordered list of TableIndexDescriptor objects that describe each index in the table.

The status.indexes field in the response describes each index in the table.

Example response:

{
  "status": {
    "indexes": [
      "titleIndex",
      "authorIndex"
    ]
  }
}

Parameters

  • Python

  • TypeScript

  • Java

  • curl

Name Type Summary

table_admin_timeout_ms

int | None

A timeout, in milliseconds, to impose on the underlying API request. If not provided, the Table defaults apply. This parameter is aliased as request_timeout_ms and timeout_ms for convenience.

Name Type Summary

option?

ListIndexOptions

The options for this operation

Options (ListIndexOptions):

Name Type Summary

nameOnly?

boolean

If false or undefined, the response includes index names and metadata. If true, the response includes only index names.

timeout?

number | TimeoutDescriptor

The client-side timeout for this operation.

Name Type Summary

options

ListIndexesOptions

Specialization of index creation options.

Name Type Summary

listIndexes

command

The Data API command to get a list of indexes associated with a table in a Serverless (Vector) database.

options.explain

boolean

If true, the response includes index names and metadata. If false or unset, the response includes only index names.

Examples

The following examples demonstrate how to get index metadata for a table.

List index metadata

  • Python

  • TypeScript

  • Java

  • curl

from astrapy import DataAPIClient

# Get an existing table
client = DataAPIClient("ASTRA_DB_APPLICATION_TOKEN")
database = client.get_database("ASTRA_DB_API_ENDPOINT")
table = database.get_table("TABLE_NAME")

# List index metadata
result = table.list_indexes()

print(result)
import { DataAPIClient } from '@datastax/astra-db-ts';

// Get an existing table
const client = new DataAPIClient('ASTRA_DB_APPLICATION_TOKEN');
const database = client.db('ASTRA_DB_API_ENDPOINT');
const table = database.table('TABLE_NAME');

// List index metadata
(async function () {
  const result = await table.listIndexes();

  console.log(result);
})();
package com.example;

import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.tables.Table;
import com.datastax.astra.client.tables.definition.rows.Row;
import com.datastax.astra.client.tables.definition.indexes.TableIndexDescriptor;

import java.util.List;

public class CreateIndex {

    public static void main(String[] args) {
        // Get an existing table
        Table<Row> table = new DataAPIClient("ASTRA_DB_APPLICATION_TOKEN")
            .getDatabase("ASTRA_DB_API_ENDPOINT")
            .getTable("TABLE_NAME");

        // List index metadata
        List<TableIndexDescriptor> result = table.listIndexes();

        System.out.println(result);
    }
}
curl -sS -L -X POST "ASTRA_DB_API_ENDPOINT/api/json/v1/ASTRA_DB_KEYSPACE/ASTRA_DB_TABLE" \
--header "Token: ASTRA_DB_APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
  "listIndexes": {
    "options": {
      "explain": true
    }
  }
}'

Client reference

  • Python

  • TypeScript

  • Java

  • curl

For more information, see the client reference.

For more information, see the client reference.

For more information, see the client reference.

Client reference documentation is not applicable for HTTP.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax | Privacy policy | Terms of use | Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com