List index metadata

Gets information about the indexes associated with a specific table.

Ready to write code? See the examples for this method to get started. If you are new to the Data API, check out the quickstart.

Result

  • Python

  • TypeScript

  • Go

  • Java

  • C#

  • curl

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

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

The Go client is in preview. For more information, see astra-db-go.

Returns an unordered slice of IndexDescriptor structs that describe each index in the table.

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

Returns an unordered list of TableIndexMetadata 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": [
      {
        "name": "summary_genres_vector_index",
        "definition": {
          "column": "summary_genres_vector",
          "options": { "metric": "cosine", "sourceModel": "other" }
        },
        "indexType": "vector"
      },
      {
        "name": "rating_index",
        "definition": { "column": "rating", "options": {} },
        "indexType": "regular"
      }
    ]
  }
}

Parameters

  • Python

  • TypeScript

  • Go

  • Java

  • C#

  • curl

Use the list_indexes method, which belongs to the astrapy.table.Table class.

Method signature
(
  *,
  table_admin_timeout_ms: int,
  request_timeout_ms: int,
  timeout_ms: int,
) -> list[TableIndexDescriptor]
Name Type Summary

table_admin_timeout_ms

int

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

Use the listIndexes method, which belongs to the Table class.

Method signature
async listIndexes(
  options?: {
    nameOnly?: false,
    timeout?: number | TimeoutDescriptor,
  }
): TableIndexDescriptor[]
Name Type Summary

options

ListIndexOptions

Optional. The options for this operation. See Properties of options for more details.

Properties of options
Name Type Summary

nameOnly

false

Must be false or undefined to return metadata about the indexes. Otherwise, only the index names are returned.

timeout

number | TimeoutDescriptor

Optional. A timeout to impose on the underlying API request.

The Go client is in preview. For more information, see astra-db-go.

Use the ListIndexes method, which belongs to the Table type.

Method signature
func (t *Table) ListIndexes(
  ctx context.Context,
  opts ...options.ListIndexesOption
) ([]results.IndexDescriptor, error)
Name Type Summary

ctx

context.Context

The context for the operation.

opts

…​options.ListIndexesOption

Optional. A builder to generate options for this operation. See Methods of the ListIndexesOption builder for more details.

Methods of the ListIndexesOption builder
Method Summary

UpdateAPIOptions(v …​APIOption)

Optional. General API options for this operation, including the timeout.

Use the listIndexes method, which belongs to the com.datastax.astra.client.tables.Table class.

Method signature
List<TableIndexDescriptor> listIndexes()
List<TableIndexDescriptor> listIndexes(ListIndexesOptions options)
Name Type Summary

options

ListIndexesOptions

Optional. The options for this operation, including timeout.

Use the ListIndexesAsync method, which belongs to the Table class. You can also use ListIndexes, which is the synchronous version of the method.

Method signature
public Task<List<TableIndexMetadata>> ListIndexesAsync(
  ListIndexesOptions options = null
);
Name Type Summary

options

ListIndexesOptions

Optional. General API options for this operation, including the keyspace and timeout. For more information and examples, see Customize API interaction.

Use the listIndexes command.

Command signature
curl -sS -L -X POST "API_ENDPOINT/api/json/v1/KEYSPACE_NAME/TABLE_NAME" \
--header "Token: APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
  "listIndexes": {
    "options": {
      "explain": true
    }
  }
}'
Name Type Summary

options.explain

true

Must be true to return metadata about the indexes. Otherwise, only the index names are returned.

Examples

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

List index metadata

  • Python

  • TypeScript

  • Go

  • Java

  • C#

  • curl

from astrapy import DataAPIClient

# Get an existing table
client = DataAPIClient()
database = client.get_database(
    "API_ENDPOINT", token="APPLICATION_TOKEN"
)
table = database.get_table("TABLE_NAME")

# List indexes
result = table.list_indexes()

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

// Get an existing table
const client = new DataAPIClient();
const database = client.db("API_ENDPOINT", {
  token: "APPLICATION_TOKEN",
});
const table = database.table("TABLE_NAME");

// List indexes
(async function () {
  const result = await table.listIndexes({ nameOnly: false });

  console.log(result);
})();

The Go client is in preview. For more information, see astra-db-go.

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"log"

	"github.com/datastax/astra-db-go/v2/astra"
	"github.com/datastax/astra-db-go/v2/astra/options"
)

func main() {
	ctx := context.Background()

	// Get an existing table
	client := astra.NewClient()

	database := client.Database(
		"API_ENDPOINT",
		options.API().SetToken("APPLICATION_TOKEN"),
	)

	table := database.Table("TABLE_NAME")

	// List index metadata
	indexes, err := table.ListIndexes(ctx)

	if err != nil {
		log.Fatal(err)
	}

	output, err := json.Marshal(indexes)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(string(output))
}
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.tables.Table;
import com.datastax.astra.client.tables.definition.rows.Row;

public class Example {

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

    // List indexes
    table.listIndexes().forEach(index -> System.out.println(index));
  }
}
using System.Text.Json;
using DataStax.AstraDB.DataApi;

namespace Examples;

public class Program
{
  static async Task Main()
  {
    // Get an existing table
    var client = new DataAPIClient();
    var database = client.GetDatabase(
      "API_ENDPOINT",
      "APPLICATION_TOKEN"
    );
    var table = database.GetTable("TABLE_NAME");

    // List indexes
    var indexes = await table.ListIndexesAsync();
    Console.WriteLine(JsonSerializer.Serialize(indexes));
  }
}
curl -sS -L -X POST "API_ENDPOINT/api/json/v1/KEYSPACE_NAME/TABLE_NAME" \
  --header "Token: APPLICATION_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "listIndexes": {
    "options": {
      "explain": true
    }
  }
}'

Client reference

  • Python

  • TypeScript

  • Go

  • Java

  • C#

  • curl

For more information, see the client reference.

For more information, see the client reference.

The Go client is in preview. For more information, see astra-db-go.

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?

© Copyright IBM Corporation 2026 | 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: Contact IBM