Query the description of a search index
After a search index is created, you can use the DescribeSearchIndex operation to query the description of the search index, including the field information, index configuration, metering information, creation time, and TTL of the search index.
Prerequisites
-
An OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
-
A data table is created. Data is written to the table. For more information, see Create a data table and Write data.
-
A search index is created for the data table. For more information, see Create a search index.
API operation
/**
* Query the description of a search index that is created for a table.
* @api
*
* @param [] $request
* The request parameter, which is the table name.
* @return [] The response.
* @throws OTSClientException The exception that is thrown when a parameter error occurs or the Tablestore server returns a verification error.
* @throws OTSServerException The exception that is thrown when the Tablestore server returns an error.
* @example "src/examples/DescribeSearchIndex.php" 20
*/
public function describeSearchIndex(array $request)
Parameters
|
Parameter |
Description |
|
table_name |
The name of the data table. |
|
index_name |
The name of the search index. |
Example
The following sample code shows how to query the description of a search index.
$request = array(
'table_name' => 'php_sdk_test',
'index_name' => 'php_sdk_test_search_index'
);
$response = $otsClient->describeSearchIndex($request);
References
If an existing search index no longer meets your requirements, you can create a new search index, modify the schema of the existing search index to add, remove, or modify index fields, or adjust the TTL configuration of the search index. For more information, see Create a search index and Dynamically modify the schema of a search index.