elastification/php-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elastification/php-client

Composer 安装命令:

composer require elastification/php-client

包简介

The elastification php client aims to be a very flexible and well performing client to elasticsearch. It supports multiple transports and serializers to maximize it's flexibility.

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage Dependency Status

Latest Stable Version Total Downloads Latest Unstable Version License

SensioLabsInsight

ToDo

  • Helper for Version response compare. (Symfony/Console)
  • singular _alias Put/Post/delete/head (v1,v2?)
  • GetFieldMappingRequest (seems to be only in v1 and v2)
  • cat api (v1, v2, check if v90)
  • repository for cat (implement version check 1 and 2 only)
  • analyze (v1, v2, check if v90)
  • snapshot (v1, v2, check if v90)
  • index recovery (v1, v2, check if v90)
  • Think about an array of clients or a decision manager for get the right client (maybe voter pattern?)
  • Write documentation
  • Create Github Pages
  • Check all requests and write down missing here

Changes from Version 1x to 2x

  • NodeInfo does not have status in response
  • DeleteByQuery is removed
  • DeleteMapping is removed
  • Index/IndexStats is removed (replaced by index stats)
  • Bulk/BulkInsertRequest existing documents having new a subobject under item['error'] response
  • Bulk/BulkUpdateRequest existing documents having new a subobject under item['error'] response

Testing

The tests are devided into unit tests and integration tests.

Running the unit tests is simple (composer install is reqired):

    bin/phpunit tests/Unit

If you like coder coverage it will be placed in build folder:

    bin/phpunit --coverage-html=build tests/Unit

There are also integration test. The subfolders holding version tests. There is a vagrant repository where you can bring all wanted/needed machine alive. [Link is missing]

The phpunit-integration.xml has defined constants for each testable version.

Run integration tests for v2x versions looks like this:

    bin/phpunit --coverage-html=build -c phpunit-integration.xml tests/Integration/Request/V2x

Requests Examples

How to check if indexExists:

$indexExistsRequest = new IndexExistsRequest('index', null, $this->serializer);

try {
    $client->send($indexExistsRequest);
    return true;
} catch(ClientException $exception) {
    return false;
}

How to check if indexTypeExists:

$indexTypeExistsRequest = new IndexTypeExistsRequest('index', 'type', $this->serializer);

try {
    $client->send($indexTypeExistsRequest);
    return true;
} catch(ClientException $exception) {
    return false;
}

统计信息

  • 总下载量: 8.26k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 4
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固