You can call the ListSearchIndex operation to obtain indexes created in the current instance or associated with a table.
Prerequisites
- An OTSClient instance is initialized. For more information, see Initialization.
- A data table is created. Data is written to the table.
- A search index is created for the data table. For more information, see Create search indexes.
Parameters
Parameter | Description |
---|---|
TableName | Optional. The name of the table.
|
Examples
/// <summary>
/// List search index names.
/// </summary>
/// <param name="otsClient"></param>
public static void ListSearchIndex(OTSClient otsClient)
{
// Set the name of the table.
ListSearchIndexRequest request = new ListSearchIndexRequest(TableName);
ListSearchIndexResponse response = otsClient.ListSearchIndex(request);
// Obtain all search indexes associated with the table.
foreach (var index in response.IndexInfos)
{
Console.WriteLine("indexname:" + index.IndexName);
Console.WriteLine("tablename:" + index.TableName);
}
}