PHPackages                             archerzdip/hyperf-elasticsearch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. archerzdip/hyperf-elasticsearch

ActiveLibrary[Search &amp; Filtering](/categories/search)

archerzdip/hyperf-elasticsearch
===============================

The Elasticsearch Driver for Hyperf Scout

v2.0.2(8mo ago)43823[1 issues](https://github.com/ArcherZdip/hyperf-elasticsearch/issues)MITPHPPHP &gt;=7.2

Since Aug 18Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/ArcherZdip/hyperf-elasticsearch)[ Packagist](https://packagist.org/packages/archerzdip/hyperf-elasticsearch)[ RSS](/packages/archerzdip-hyperf-elasticsearch/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (5)Used By (0)

Hyperf Elasticsearch Driver
===========================

[](#hyperf-elasticsearch-driver)

根据 [babenkoivan/scout-elasticsearch-driver](https://github.com/babenkoivan/scout-elasticsearch-driver) 改造的基于Hyperf框架的ElasticSearch组件。

---

[![GitHub issues](https://camo.githubusercontent.com/ddf07130dae343abdd885e9674009529a1d5b0204c7f01e27d6e6b7efdcea1f1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f4172636865725a6469702f6879706572662d656c61737469637365617263683f7374796c653d706c6173746963)](https://github.com/ArcherZdip/hyperf-elasticsearch/issues)[![GitHub forks](https://camo.githubusercontent.com/9a744120ff8be3250915bb10b06dc317e30dbcb425cff24707d17b93b335e403/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f4172636865725a6469702f6879706572662d656c61737469637365617263683f7374796c653d706c6173746963)](https://github.com/ArcherZdip/hyperf-elasticsearch/network)[![GitHub stars](https://camo.githubusercontent.com/05b520d409e503a32f6a098bb0a2dbbef6d1f9fa1e5f6ebe06dee9f6f78449f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4172636865725a6469702f6879706572662d656c61737469637365617263683f7374796c653d706c6173746963)](https://github.com/ArcherZdip/hyperf-elasticsearch/stargazers)

Requirements
------------

[](#requirements)

- PHP version &gt;=7.2.0
- Hyperf Framework version &gt;2.0
- Elasticsearch version &gt;=7

Installation
------------

[](#installation)

```
composer require archerzdip/hyperf-elasticsearch
```

Configuration
-------------

[](#configuration)

> 发布配置文件

```
php bin/hyperf.php vendor:publish archerzdip/hyperf-elasticsearch
```

- 配置文件在config/autoload/scout\_elastic.php， 配置参数如下： \*

OptionDescriptiondriver默认defalutsoft\_delete是否软删除prefix前缀client.hostElasticSearch client, default `localhost:9200`.如果存在密码: `user:password@host:port`max\_connections最大连接数，默认500timeout超时时间，默认10sindexer索引方式,目前支持`single`和`bulk`chunk.searchable批量处理的搜索块数量chuck.unsearchable批量处理的搜索块数量update\_mapping是否自动更新，默认 `true`document\_refreshThis option controls when updated documents appear in the search results. Can be set to 'true', 'false', 'wait\_for' or null. More details about this option you can find [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-refresh.html). By default set to null.Index Configurator
------------------

[](#index-configurator)

所以配置器类用于设置ElasticSearch的索引，可使用以下方式创建新的索引配置器：

```
php bin/hyperf.php make:index-configurator MyIndexConfigurator
```

默认目录为`App\ElasticIndexConfigurator\MyIndexConfigurator`

```
