You can call the DescribeSearchIndex operation to query the description of a search index for a table, including the fields, configurations, read and write capacity units (CUs), and creation time of the search index.
Prerequisites
An OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
A data table is created and data is written to the data table. For more information, see Create data tables and Write data.
A search index is created for the data table. For more information, see Create search indexes.
Parameters
Parameter | Description |
TableName | The name of the data table. |
IndexName | The name of the search index. |
Examples
The following sample code shows how to query the description of a search index.
/// <summary>
/// Query the description of a search index.
/// </summary>
/// <param name="otsClient"></param>
public static void DescribeSearchIndex(OTSClient otsClient)
{
// Specify the names of the table and search index.
DescribeSearchIndexRequest request = new DescribeSearchIndexRequest(TableName, IndexName);
DescribeSearchIndexResponse response = otsClient.DescribeSearchIndex(request);
string serializedObjectString = JsonConvert.SerializeObject(response);
Console.WriteLine(serializedObjectString); // Display the details of the response.
}
References
If existing search indexes do not meet your business requirements, you can create search indexes or modify the schemas of existing search indexes to add, remove, and modify index columns. For more information, see Create search indexes and Dynamically modify the schema of a search index.