Overview
The AppClient class is used to manage the basic information about applications. This class provides various methods. The save method is used to create an application. The updateById method is used to update an application. The removeById method is used to delete an application. The getById method is used to query the basic information about an application. The listAll method is used to query all applications. The reindexById method is used to perform a full data import to an application.
Constructor
Method definition
void OpenSearch\Client\AppClient::__construct( $openSearchClient)
Parameter description
Parameter | Type | Description |
$openSearchClient | \OpenSearch\Client\OpenSearchClient | The OpenSearchClient object. The OpenSearchClient class is a basic class that can be used to calculate signatures, interact with servers, and return the results. |
save
Creates an application or another version of an existing application. If you specify the name of an existing application in the $app parameter, the save method creates another version of the application. Otherwise, the save method creates an application.
The maximum number of versions that can be created for an application is limited by the server.
Method definition
\OpenSearch\Generated\Common\OpenSearchResult OpenSearch\Client\AppClient::save( $app)
Parameter description
Parameter | Type | Description |
$app | STRING | The JSON string to be used to create an application. The string contains fields such as name, type, schema, quota, first_ranks, second_ranks, summary, data_sources, suggest, fetch_fields, and query_processors. |
getById
Queries the detailed information about an application. When you call this method, specify the name or ID of the application whose information you want to query.
Method definition
\OpenSearch\Generated\Common\OpenSearchResult OpenSearch\Client\AppClient::getById( $identity)
Parameter description
Parameter | Type | Description |
$identity | STRING | The name or ID of the application whose information you want to query. If the specified application has multiple versions, this method returns the information about the online version of the application. |
listAll
Queries applications that are managed within the current Alibaba Cloud account.
Method definition
\OpenSearch\Generated\Common\OpenSearchResult OpenSearch\Client\AppClient::listAll( $pageable)
Parameter description
Parameter | Type | Description |
$pageable | \OpenSearch\Generated\Common\Pageable | The paging configurations, which include the page number and the number of entries to be displayed on each page. |
removeById
Deletes an application or a version of an existing application. When you call this method, specify the name or ID of the application that you want to delete.
If you specify the name of an application group, the online application in the application group is deleted.
If the specified application has only one version, the entire application group is deleted.
If the specified application has multiple versions, the version to be deleted cannot be the online version.
Method definition
\OpenSearch\Generated\Common\OpenSearchResult OpenSearch\Client\AppClient::removeById( $identity)
Parameter description
Parameter | Type | Description |
$identity | STRING | The name or ID of the application that you want to delete. |
updateById
Updates an application. When you call this method, specify the name or ID of the application that you want to update.
Method definition
\OpenSearch\Generated\Common\OpenSearchResult OpenSearch\Client\AppClient::updateById( $identity, $app)
Parameter description
Parameter | Type | Description |
$identity | STRING | The name or ID of the application that you want to update. If you specify the name of an application group, the online application in the application group is updated. |
$app | STRING | The JSON string to be used to update the specified application. The string contains fields such as name, type, schema, quota, first_ranks, second_ranks, summary, data_sources, suggest, fetch_fields, and query_processors. |
reindexById
Performs reindexing for an application. The rebuilding of indexes requires preparing source data and performing a full data import.
Method definition
\OpenSearch\Generated\Common\OpenSearchResult OpenSearch\Client\AppClient::reindexById( $identity)
Parameter description
Parameter | Type | Description |
$identity | STRING | The name or ID of the application for which you want to perform reindexing. If you specify the name of an application group, reindexing is triggered for the online application in the application group. |