All Products
Search
Document Center

AppClient

Last Updated: Sep 09, 2021

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 obtain the basic information about an application. The listAll method is used to obtain a list of 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 set the $app parameter to the name of an existing application, the save method creates another version of the application. If you do not specify the $app parameter, the save method creates an application.

Note

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

Obtains the detailed information about an application. When you call this method, specify the name or ID of the application whose information you want to obtain.

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 obtain. If the specified application has multiple versions, this method returns the information about the online version of the application.


listAll

Obtains a list of 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 will be deleted.

  • If the specified application has only one version, the entire application group will be 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 will be 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

Rebuilds indexes 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 rebuild indexes. If you specify the name of an application group, indexes are rebuilt for the online application in the application group.