Tablestore SDK for Java lists all search indexes for a table and returns the table and index names for each entry.
Prerequisites
Before you begin, make sure that:
-
You have installed the Tablestore SDK for Java and initialized the client.
-
The table exists.
Description
Call listSearchIndex to list all search indexes for a table. Specify the table name in the request.
public ListSearchIndexResponse listSearchIndex(ListSearchIndexRequest request)
The following example lists all search indexes for example_table and prints the table and index names.
String tableName = "example_table";
ListSearchIndexRequest request = new ListSearchIndexRequest();
request.setTableName(tableName);
ListSearchIndexResponse response = client.listSearchIndex(request);
for (SearchIndexInfo indexInfo : response.getIndexInfos()) {
System.out.printf(
"tableName=%s, indexName=%s%n",
indexInfo.getTableName(),
indexInfo.getIndexName());
}
Parameters
ListSearchIndexRequest contains the following parameter:
|
Name |
Type |
Description |
|
tableName (required) |
|
The table name. |
Response
ListSearchIndexResponse contains the following field:
|
Field |
Type |
Description |
|
|
|
Call |
Search index information
Each element in indexInfos[] is a SearchIndexInfo object that contains the following fields:
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |