Download the PHP package zround/sphinxapi without Composer

On this page you can find all versions of the php package zround/sphinxapi. 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 sphinxapi

SphinxClient PHP API (SphinxQL)

基于 SphinxQL(MySQL 协议)的 PHP Sphinx searchd 客户端,兼容原始 sphinxapi.php 的全部公共方法签名和返回值格式,可直接替换原有调用代码。

A PHP Sphinx searchd client based on SphinxQL (MySQL protocol), fully compatible with the original sphinxapi.php public method signatures and return value formats — drop-in replacement.

背景 / Background

Sphinx 官方已推荐使用 SphinxQL(TCP 9306 端口,MySQL 协议)替代原生二进制协议(TCP 9312 端口)。本项目将 SphinxClient 的内部实现从 fsockopen + 二进制打包改为 PDO + SphinxQL,上层代码无需任何修改。

Sphinx officially recommends SphinxQL (TCP port 9306, MySQL protocol) over the native binary protocol (TCP port 9312). This project rewrites SphinxClient internals from fsockopen + binary packing to PDO + SphinxQL, requiring no changes to upper-layer code.

要求 / Requirements

安装 / Installation

使用方式 / Usage

API 方法 / API Methods

连接 / Connection

方法 / Method 说明 / Description
SetServer($host, $port) 设置服务地址,默认端口 9306 / Set server address, default port 9306
SetConnectTimeout($timeout) 连接超时(秒)/ Connection timeout (seconds)
Open() 保持持久连接 / Open persistent connection
Close() 关闭持久连接 / Close persistent connection
Ping() 检测服务是否存活 / Check if server is alive

查询参数 / Query Parameters

方法 / Method 说明 / Description
SetLimits($offset, $limit, $max, $cutoff) 分页与截断 / Pagination and cutoff
SetMaxQueryTime($ms) 最大查询时间 / Max query time
SetRankingMode($ranker, $rankexpr) 排名模式 / Ranking mode
SetSortMode($mode, $sortby) 排序模式 / Sort mode
SetWeights($weights) 字段权重(旧接口)/ Field weights (deprecated)
SetFieldWeights($weights) 字段权重 / Field weights
SetIndexWeights($weights) 索引权重 / Index weights
SetIDRange($min, $max) 文档 ID 范围 / Document ID range
SetFilter($attr, $values, $exclude) 整数过滤 / Integer filter
SetFilterRange($attr, $min, $max, $exclude) 范围过滤 / Range filter
SetFilterFloatRange($attr, $min, $max, $exclude) 浮点范围过滤 / Float range filter
SetFilterString($attr, $value, $exclude) 字符串过滤 / String filter
SetFilterStringList($attr, $value, $exclude) 字符串列表过滤 / String list filter
SetGroupBy($attr, $func, $groupsort) 分组 / Grouping
SetGroupDistinct($attr) 去重计数 / Distinct count
SetRetries($count, $delay) 重试 / Retries
SetArrayResult($on) 结果用数字索引 / Use numeric index for results
SetSelect($select) 自定义 SELECT 列 / Custom SELECT columns
SetQueryFlag($name, $value) 查询标志位 / Query flags
SetOuterSelect($orderby, $offset, $limit) 外层子查询 / Outer subquery
ResetFilters() 重置过滤 / Reset filters
ResetGroupBy() 重置分组 / Reset group-by
ResetQueryFlag() 重置查询标志 / Reset query flags
ResetOuterSelect() 重置外层查询 / Reset outer select

执行查询 / Query Execution

方法 / Method 说明 / Description
Query($query, $index, $comment) 单次查询 / Single query
AddQuery($query, $index, $comment) 添加到批量队列 / Add to batch queue
RunQueries() 执行批量队列 / Execute batch queue

辅助方法 / Helper Methods

方法 / Method 说明 / Description
BuildExcerpts($docs, $index, $words, $opts) 高亮摘要 / Build excerpts
BuildKeywords($query, $index, $hits) 关键词分词 / Tokenize keywords
EscapeString($string) Sphinx 查询语法转义 / Escape Sphinx query syntax
UpdateAttributes($index, $attrs, $values, ...) 即时更新属性 / Update attributes in-place
Status($session) 服务状态 / Server status
FlushAttributes() 刷写属性到磁盘 / Flush attributes to disk
GetLastError() 最近错误 / Last error
GetLastWarning() 最近警告 / Last warning
IsConnectError() 是否连接错误 / Whether connection error

与原版的差异 / Differences from Original

项目 / Item 说明 / Description
默认端口 / Default port 9312 → 9306
批量查询 / Batch queries 原版单次 TCP 发送全部查询,现改为逐条执行 / Originally sent all queries in one TCP call, now executes sequentially
FlushAttributes 无法返回 flush tag,返回 0 / Cannot return flush tag, returns 0
SetTokenFilter 无 SphinxQL 等价,调用时设警告忽略 / No SphinxQL equivalent, issues warning and ignores
SPH_SORT_TIME_SEGMENTS 用 INTERVAL() 近似,行为有差异 / Uses INTERVAL() approximation, behavior differs

文件 / Files


All versions of sphinxapi with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-pdo Version *
ext-pdo_mysql Version *
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 zround/sphinxapi contains the following files

Loading the files please wait ...