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
An OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
A data table is created.
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. This parameter cannot be left empty. |
Examples
The following sample code provides an example on how to list search indexes that are created for a table:
private static List<SearchIndexInfo> listSearchIndex(SyncClient client) {
ListSearchIndexRequest request = new ListSearchIndexRequest();
// Specify the name of the data table.
request.setTableName("<TABLE_NAME>");
// Query all search indexes that are created for the data table.
return client.listSearchIndex(request).getIndexInfos();
}
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 a search index.