首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

SphinxClient::query

(PECL sphinx >= 0.1.0)

SphinxClient::query — Execute search query

Description

代码语言:javascript
复制
public array SphinxClient::query ( string $query [, string $index = "*" [, string $comment = "" ]] )

Connects to searchd server, runs the given search query with the current settings, obtains and returns the result set.

Parameters

query

Query string.

index

An index name (or names).

comment

Return Values

On success, SphinxClient::query() returns a list of found matches and additional per-query statistics. The result set is a hash utilize other structures instead of hash) with the following keys and values:

Key

Value description

"matches"

An array with found document IDs as keys and their weight and attributes values as values

"total"

Total number of matches found and retrieved (depends on your settings)

"total_found"

Total number of found documents matching the query

"words"

An array with words (case-folded and stemmed) as keys and per-word statistics as values

"error"

Query error message reported by searchd

"warning"

Query warning reported by searchd

See Also

  • SphinxClient::runQueries
  • SphinxClient::addQuery

SphinxClient::resetFilters →

代码语言:txt
复制
 © 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券