elastic/elasticsearch-serverless

PHP Client for Elasticsearch serverless

v0.1.0-alpha2 2023-11-06 14:18 UTC

This package is auto-updated.

Last update: 2024-04-07 19:33:05 UTC


README

main

This is the official Elastic client for the Elasticsearch Serverless service, still in private preview. If you're looking to develop your PHP application with the Elasticsearch Stack, you should look at the Elasticsearch Client instead. If you're looking to develop your PHP application with Elastic Enterprise Search, you should look at the Enterprise Search Client.

Installation

You can install the library using composer with the following command:

composer require elastic/elasticsearch-serverless

You need specify the version, if you want to install an alpha or rc release. For instance, if you want to install the latest alpha version:

composer require elastic/elasticsearch-serverless:*@alpha

Please remember that alpha releases are quite unstable, the code can change between releases. Instead, a release candidate rc will not break the backward compatibility. Typically an rc version includes only bug fixes.

Instantiate a Client

When you have installed elasticsearch-php you can start using it with the `Client`` class. You can use the ClientBuilder class to create this object:

require 'vendor/autoload.php';

use Elastic\Elasticsearch\Serverless\ClientBuilder;

$client = ClientBuilder::create()
  ->setEndpoint('<elasticsearch-endpoint>')
  ->setApiKey('<api-key>')
  ->build();

# $client is an object of Elastic\Elasticsearch\Serverless\Client class

Usage

You can read to the official documentation page for a getting started guide.

Development

See CONTRIBUTING.

Docs

Some questions, assumptions and general notes about this project can be found in the docs directory.

License 📗

MIT © Elastic