nailsapp/module-elasticsearch

此包已被废弃且不再维护。作者建议使用nails/module-elasticsearch包。

这是Nails的"Elasticsearch"模块。

dev-develop 2022-01-31 17:20 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:51:53 UTC


README

license tests Scrutinizer Code Quality

这是Nails的Elasticsearch模块,它提供了一个面向Nails的友好接口来操作Elasticsearch PHP客户端

安装Elasticsearch

您应遵循Elastic官方文档页面上的最新安装说明。

配置您的应用程序

通过定义一个名为hosts的服务属性来配置客户端连接到的主机。默认情况下,它将连接到localhost:9200

如果您希望在您的应用程序中覆盖此设置,请创建位于application/services/nails/module-elasticsearch/services.php文件。

以下是一个示例services.php

/**
 * Include the base services file so that the client can be instantiated,
 * remember you are simply overriding defaults.
 */
$aServices = include 'vendor/nails/module-elasticsearch/services/services.php';

/**
 * Define an array of hosts for the Elasticsearch client to use.
 */
$aServices['properties']['hosts'] = array(
    'http://example.com:1234',
    'http://example.co.uk:9200'
);

/**
 * Remember to return the services array so that the Nails Factory picks it up
 */
return $aServices;