This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Enterprise Search API
editEnterprise Search API
editHealth API
editThe documentation of the Health API is reported here.
use Elastic\EnterpriseSearch\Client; use Elastic\EnterpriseSearch\EnterpriseSearch\Request; use Elastic\EnterpriseSearch\EnterpriseSearch\Schema; $client = new Client([ 'host' => 'http://localhost:3002', 'enterprise-search' => [ 'username' => '<insert here the username>', 'password' => '<insert here the password>' ] ]); $enterpriseSearch = $client->enterpriseSearch(); $response = $enterpriseSearch->getHealth(new Request\GetHealth); print_r($response->asArray());
Version API
edit$result = $enterpriseSearch->getVersion(new Request\GetVersion); print_r($response->asArray());
Managing Read-Only mode:
editThe documentation of the Read-Only mode API is reported here.
// Set read-only flag state $enterpriseSearch->putReadOnly( new Request\PutReadOnly( new ReadOnlyState(true) ) ); // Get read-only flag state $result = $enterpriseSearch->getReadOnly(new Request\GetReadOnly); var_dump($result['enabled']);