nailsapp / module-elasticsearch
dev-develop
2022-01-31 17:20 UTC
Requires
- elasticsearch/elasticsearch: ~7.0
- nails/common: dev-develop
- nails/module-api: dev-develop
- nails/module-console: dev-develop
Requires (Dev)
- phpstan/phpstan: 1.*
- phpunit/phpunit: 9.*
This package is not auto-updated.
Last update: 2022-02-01 12:51:53 UTC
README
这是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;