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 |
table_name | The name of the data table. This parameter is optional.
|
Examples
The following sample code shows how to list search indexes that are created for a table.
# Specify the name of the data table.
for table, index_name in client.list_search_index("<TABLE_NAME>"):
print(table, index_name)
References
If you want to use a search index to query data, you can use features such as term query, terms query, match all query, match query, match phrase query, prefix query, range query, wildcard query, exists query, geo query, and nested query. When you query data, you can use features such as sorting and paging and collapse (distinct) to sort and deduplicate data.
You can also query data based on a combination of subqueries. For more information, see Boolean query.
If you want to use a search index to collect statistics and analyze data, you can use the aggregation feature. For example, you can use the aggregation feature to obtain the maximum value, sum, and average value, and group query results. For more information, see Aggregation.
If you want to return all data that meets the query conditions in an efficient manner, you can use parallel scan. For more information, see Parallel scan.
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.