承接 sphinx/client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sphinx/client

Composer 安装命令:

composer require sphinx/client

包简介

Sphinx API client

关键字:

README 文档

README

See this bug report for more info.

Latest Stable Version Total Downloads Latest Unstable Version Build Status Code Coverage Scrutinizer Code Quality SensioLabsInsight License

Sphinx PHP client

Copy / paste from sphinxsearch/sphinx

Installation

Add the following to the require section of your composer.json file:

"sphinx/client": "dev-master"

Usage

Search test word in Sphinx for example_idx index.

use Sphinx\Client;

$sphinx = new Client();
$sphinx->setServer('localhost', 6712);
$sphinx->setMatchMode(Client::MATCH_ANY);
$sphinx->setMaxQueryTime(3);

$result = $sphinx->query('test', 'example_idx');

var_dump($result);

Printed result:

array(10) {
  ["error"]=>
  string(0) ""
  ["warning"]=>
  string(0) ""
  ["status"]=>
  int(0)
  ["fields"]=>
  array(3) {
    [0]=>
    string(7) "subject"
    [1]=>
    string(4) "body"
    [2]=>
    string(6) "author"
  }
  ["attrs"]=>
  array(0) {
  }
  ["matches"]=>
  array(1) {
    [3]=>
    array(2) {
      ["weight"]=>
      int(1)
      ["attrs"]=>
      array(0) {
      }
    }
  }
  ["total"]=>
  int(1)
  ["total_found"]=>
  int(1)
  ["time"]=>
  float(0)
  ["words"]=>
  array(1) {
    ["to"]=>
    array(2) {
      ["docs"]=>
      int(1)
      ["hits"]=>
      int(1)
    }
  }
}

License

This bundle is under the GPL-3.0 license. See the complete license in the file: LICENSE

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-03-29