项目作者: Timandes

项目描述 :
PHP Client for Aliyun Opensearch
高级语言: PHP
项目地址: git://github.com/Timandes/opensearch-php.git
创建时间: 2019-03-17T06:42:25Z
项目社区:https://github.com/Timandes/opensearch-php

开源协议:Apache License 2.0

下载


Opensearch PHP

PHP Client for Aliyun Opensearch

How to install

  1. composer require opensearch-dev/opensearch

Work with Swoole

  1. go(function() {
  2. $coClient = new OpenSearch\Client\OpenSearchClient('some-key', 'some-secret',
  3. 'http://opensearch-cn-hangzhou.aliyuncs.com');
  4. $coClient->setHttpHandler(new OpenSearch\Client\Handler\SwooleHttpHandler()); // 更换请求处理器
  5. $resultObj = $coClient->get('/apps');
  6. $resultJSON = $resultObj->result;
  7. $result = json_decode($resultJSON, true);
  8. fprintf(STDOUT, "name=%s" . PHP_EOL, $result['result']['name']);
  9. });

Resources