pmishev/elasticsearch-dsl-php
最新稳定版本:v8.0.0
Composer 安装命令:
composer require pmishev/elasticsearch-dsl-php
包简介
Elasticsearch DSL library
README 文档
README
Elasticsearch DSL library to provide objective query builder for the elasticsearch-php client. You can easily build any Elasticsearch query and transform it to an array.
This is a fork of the abandoned https://github.com/ongr-io/ElasticsearchDSL
Version matrix
| Elasticsearch version | Bundle version |
|---|---|
| >= 8.0 | >= 8.0 |
| >= 7.0 | >= 7.0 |
| >= 6.0, < 7.0 | >= 6.0 |
| >= 5.0, < 6.0 | >= 5.0 |
Documentation
The online documentation of the bundle is here
Try it!
Installation
$ composer require pmishev/elasticsearch-dsl-php ^8.0
Example usage
<?php require 'vendor/autoload.php'; // Composer autoload use Elasticsearch\ClientBuilder; use ONGR\ElasticsearchDSL\Query\MatchAllQuery; use ONGR\ElasticsearchDSL\Search; // Build an elasticsearch-php client $clientBuilder = ClientBuilder::create(); $clientBuilder->setHosts(['localhost:9200']); $client = $clientBuilder->build(); $search = (new Search())->addQuery(new MatchAllQuery()); $params = [ 'index' => 'your_index', 'body' => $search->toArray(), ]; $results = $client->search($params);
统计信息
- 总下载量: 1.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-02