elastic / elasticsearch-serverless
PHP Client for Elasticsearch serverless
Requires
- php: ^8.0
- elastic/transport: ^8.7
- guzzlehttp/guzzle: ^7.0
- psr/http-client: ^1.0
- psr/http-message: ^1.0
- psr/log: ^1|^2|^3
Requires (Dev)
- mockery/mockery: ^1.5
- nyholm/psr7: ^1.5
- php-http/message-factory: ^1.1
- php-http/mock-client: ^1.5
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^9.5
- symfony/finder: ~4.0
- symfony/http-client: ^5.0|^6.0
- symfony/yaml: ^5.0
This package is auto-updated.
Last update: 2024-04-07 19:33:05 UTC
README
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.