elastic/enterprise-search

企业搜索官方PHP客户端


README

A first-party PHP client to interface with Elastic Enterpise Search including Elastic App Search and Elastic Workplace Search.

安装

可以使用 composer 安装此包

composer require elastic/enterprise-search

版本遵循Elastic Stack版本,因此 8.0 与Elastic Stack 8.0中发布的企业搜索兼容。

PSR-18 HTTP库

本项目使用 elastic-transport-php 作为HTTP库。这是一个抽象使用任何PSR-18客户端库的组件。它使用HTTPlug的自动发现功能来查找在您的 vendor 中已安装的符合规范的库。如果您收到类似 No PSR-18 clients found 的错误,这意味着您没有安装任何PSR-18库。我们建议使用Guzzle v7+ 作为HTTP库。您可以使用composer安装它。

composer require guzzlehttp/guzzle

如果您想确保使用特定的HTTP库,需要在 Client 构造函数中传递它,如下所示

use Elastic\EnterpriseSearch\Client;

$client = new Client([
    'client' => new GuzzleHttp\Client,
   // ...
]);

Guzzle v6

如果您想使用Guzzle v6,需要将 php-http/guzzle6-adapter 作为composer需求添加。

文档

查看文档 了解如何开始使用、兼容性信息、配置和API参考。

贡献

如果您想为 enterprise-search-php 贡献,我们提供了 贡献文档,以确保您的第一次贡献顺利进行。

许可证

enterprise-search-php 在MIT许可证下提供。有关更多详细信息,请参阅 LICENSE