All Products
Search
Document Center

Tablestore:List search indexes

Last Updated:Aug 19, 2024

After you create search indexes for a data table, you can call the ListSearchIndex operation to list the search indexes that are created for the data table.

Prerequisites

Parameters

Parameter

Description

TableName

Required. The name of the data table.

Examples

The following sample code provides an example on how to list search indexes that are created for a table:

/// <summary>
/// List the names of the search indexes. 
/// </summary>
/// <param name="otsClient"></param>
public static void ListSearchIndex(OTSClient otsClient)
{
    // Specify the name of the data table. 
    ListSearchIndexRequest request = new ListSearchIndexRequest(TableName);
    ListSearchIndexResponse response = otsClient.ListSearchIndex(request);
    // Query all search indexes associated with the data table. 
    foreach (var index in response.IndexInfos)
    {
        Console.WriteLine("indexname:" + index.IndexName);
        Console.WriteLine("tablename:" + index.TableName);
    }
}

References

  • If you want to query details about a search index, such as the fields and schema of the search index, you can query the description of the search index. For more information, see Query the description of a search index.

  • If you no longer use a search index, you can delete the search index. For more information, see Delete search indexes.