Download the PHP package archerzdip/hyperf-elasticsearch without Composer

On this page you can find all versions of the php package archerzdip/hyperf-elasticsearch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hyperf-elasticsearch

Hyperf Elasticsearch Driver

根据 babenkoivan/scout-elasticsearch-driver 改造的基于Hyperf框架的ElasticSearch组件。


GitHub issues GitHub forks GitHub stars

Requirements

Installation

Configuration

发布配置文件

Option Description
driver 默认defalut
soft_delete 是否软删除
prefix 前缀
client.host ElasticSearch client, default localhost:9200.如果存在密码: user:password@host:port
max_connections 最大连接数,默认500
indexer 索引方式,目前支持singlebulk
chunk.searchable 批量处理的搜索块数量
chuck.unsearchable 批量处理的搜索块数量
update_mapping 是否自动更新,默认 true
document_refresh This 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. By default set to null.

Index Configurator

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

默认目录为App\ElasticIndexConfigurator\MyIndexConfigurator

More about index settings you can find in the index management section of Elasticsearch documentation.

Searchable Model

Usage

Basic search usage example:

If you only need the number of matches for a query, use the count method:

If you need to load relations, use the with method:

In addition to standard functionality the package offers you the possibility to filter data in Elasticsearch without specifying a query string:

Also you can override model search rules:

And use variety of where conditions:

And filter out results with a score less than min_score:

And add more complex sorting (geo_distance eg.)

At last, if you want to send a custom request, you can use the searchRaw method:

This query will return raw response.

Console Commands

Command Arguments Description
make:index-configurator name - The name of the class Creates a new Elasticsearch index configurator.
make:searchable-model name - The name of the class Creates a new searchable model.
make:search-rule name - The name of the class Creates a new search rule.
elastic:create-index index-configurator - The index configurator class Creates an Elasticsearch index.
elastic:update-index index-configurator - The index configurator class Updates settings and mappings of an Elasticsearch index.
elastic:drop-index index-configurator - The index configurator class Drops an Elasticsearch index.
elastic:update-mapping model - The model class Updates a model mapping.
elastic:migrate-model model - The model class, target-index - The index name to migrate Migrates model to another index.

For detailed description and all available options run php bin/hyperf.php help [command] in the command line.

Search rules

默认目录为App\ElasticSearchRule\MySearchRule

License

MIT


All versions of hyperf-elasticsearch with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
hyperf/elasticsearch Version ~2.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package archerzdip/hyperf-elasticsearch contains the following files

Loading the files please wait ....