Свойство | Тип | Описание | |
---|---|---|---|
$_anchor | < distributed retries delay | ||
$_arrayresult | < stored mbstring encoding | ||
$_connerror | < last warning message | ||
$_cutoff | < max matches to retrieve | ||
$_error | < select-list (attributes or expressions, with optional aliases) | ||
$_fieldweights | < max query time, milliseconds (default is 0, do not limit) | ||
$_filters | < max ID to match (default is 0, which means no limit) | ||
$_groupby | < search filters | ||
$_groupdistinct | < group-by sorting clause (to sort groups in result set with) | ||
$_groupfunc | < group-by attribute name | ||
$_groupsort | < group-by function (to pre-process group-by attribute value with) | ||
$_host | |||
$_indexweights | < geographical anchor point | ||
$_limit | < how many records to seek from result-set start (default is 0) | ||
$_max_id | < min ID to match (default is 0, which means no limit) | ||
$_maxmatches | < group-by count-distinct attribute | ||
$_maxquerytime | < ranking mode expression (for SPH_RANK_EXPR) | ||
$_mbenc | < requests array for multi-query | ||
$_min_id | < attribute to sort by (defualt is "") | ||
$_mode | < how many records to return from result-set starting at offset (default is 20) | ||
$_offset | < searchd port (default is 9312) | ||
$_overrides | < per-field-name weights | ||
$_port | < searchd host (default is "localhost") | ||
$_ranker | < per-index weights | ||
$_rankexpr | < ranking mode (default is SPH_RANK_PROXIMITY_BM25) | ||
$_reqs | < connection error vs remote error flag | ||
$_retrycount | < cutoff to stop searching at (default is 0) | ||
$_retrydelay | < distributed retries count | ||
$_select | < per-query attribute values overrides | ||
$_sort | < per-field weights (default is 1 for all fields) | ||
$_sortby | < match sorting mode (default is SPH_SORT_RELEVANCE) | ||
$_timeout | < whether $result["matches"] should be a hash or an array | ||
$_warning | < last error message | ||
$_weights | < query matching mode (default is SPH_MATCH_ALL) |
Метод | Описание | |
---|---|---|
AddQuery ( $query, $index = "*", $comment = "" ) | returns index into results array from RunQueries() call | |
BuildExcerpts ( $docs, $index, $words, $opts = [] ) | an array of snippets on success | |
BuildKeywords ( $query, $index, $hits ) | an array of words on success | |
Close ( ) | ||
EscapeString ( $string ) | ||
FlushAttributes ( ) | ||
GetLastError ( ) | get last error message (string) | |
GetLastWarning ( ) | get last warning message (string) | |
IsConnectError ( ) | get last error flag (to tell network connection errors from searchd errors or broken responses) | |
Open ( ) | ||
Query ( $query, $index = "*", $comment = "" ) | and return the search results | |
ResetFilters ( ) | clear all filters (for multi-queries) | |
ResetGroupBy ( ) | clear groupby settings (for multi-queries) | |
ResetOverrides ( ) | clear all attribute value overrides (for multi-queries) | |
RunQueries ( ) | connect to searchd, run queries batch, and return an array of result sets | |
SetArrayResult ( $arrayresult ) | PHP specific; needed for group-by-MVA result sets that may contain duplicate IDs | |
SetConnectTimeout ( $timeout ) | set server connection timeout (0 to remove) | |
SetFieldWeights ( $weights ) | bind per-field weights by name | |
SetFilter ( $attribute, $values, $exclude = false ) | only match records where $attribute value is in given set | |
SetFilterFloatRange ( $attribute, $min, $max, $exclude = false ) | only match records if $attribute value is beetwen $min and $max (inclusive) | |
SetFilterRange ( $attribute, $min, $max, $exclude = false ) | only match records if $attribute value is beetwen $min and $max (inclusive) | |
SetGeoAnchor ( $attrlat, $attrlong, $lat, $long ) | latitude and longitude must be in radians | |
SetGroupBy ( $attribute, $func, $groupsort = "@group desc" ) | set grouping attribute and function | |
SetGroupDistinct ( $attribute ) | set count-distinct attribute for group-by queries | |
SetIDRange ( $min, $max ) | only match records if document ID is beetwen $min and $max (inclusive) | |
SetIndexWeights ( $weights ) | bind per-index weights by name | |
SetLimits ( $offset, $limit, $max, $cutoff ) | and optionally set max-matches and cutoff limits | |
SetMatchMode ( $mode ) | set matching mode | |
SetMaxQueryTime ( $max ) | integer, 0 means "do not limit" | |
SetOverride ( $attrname, $attrtype, $values ) | $values must be a hash that maps document IDs to attribute values | |
SetRankingMode ( $ranker, $rankexpr = "" ) | set ranking mode | |
SetRetries ( $count, $delay ) | set distributed retries count and delay | |
SetSelect ( $select ) | set select-list (attributes or expressions), SQL-like syntax | |
SetServer ( $host, $port ) | set searchd host name (string) and port (integer) | |
SetSortMode ( $mode, $sortby = "" ) | set matches sorting mode | |
SetWeights ( $weights ) | DEPRECATED; use SetFieldWeights() instead | |
SphinxClient ( ) | create a new client object and fill defaults | |
Status ( ) | ||
UpdateAttributes ( $index, $attrs, $values, $mva = false ) | returns amount of updated documents (0 or more) on success, or -1 on failure | |
_Connect ( ) | connect to searchd server | |
_GetResponse ( $fp, $client_ver ) | get and check response packet from searchd server | |
_MBPop ( ) | leave mbstring workaround mode | |
_MBPush ( ) | enter mbstring workaround mode | |
_PackFloat ( $f ) | helper to pack floats in network byte order | |
_ParseSearchResponse ( $response, $nreqs ) | parse and return search query (or queries) response | |
_Send ( $handle, $data, $length ) | ||
__destruct ( ) |
public AddQuery ( $query, $index = "*", $comment = "" ) |
public BuildExcerpts ( $docs, $index, $words, $opts = [] ) |
public BuildKeywords ( $query, $index, $hits ) |
public IsConnectError ( ) |
public Query ( $query, $index = "*", $comment = "" ) |
public ResetOverrides ( ) |
public RunQueries ( ) |
public SetArrayResult ( $arrayresult ) |
public SetConnectTimeout ( $timeout ) |
public SetFieldWeights ( $weights ) |
public SetFilter ( $attribute, $values, $exclude = false ) |
public SetFilterFloatRange ( $attribute, $min, $max, $exclude = false ) |
public SetFilterRange ( $attribute, $min, $max, $exclude = false ) |
public SetGeoAnchor ( $attrlat, $attrlong, $lat, $long ) |
public SetGroupBy ( $attribute, $func, $groupsort = "@group desc" ) |
public SetGroupDistinct ( $attribute ) |
public SetIDRange ( $min, $max ) |
public SetIndexWeights ( $weights ) |
public SetLimits ( $offset, $limit, $max, $cutoff ) |
public SetOverride ( $attrname, $attrtype, $values ) |
public SetRetries ( $count, $delay ) |
public SetSelect ( $select ) |
public SetServer ( $host, $port ) |
public SetWeights ( $weights ) |
public UpdateAttributes ( $index, $attrs, $values, $mva = false ) |
public _GetResponse ( $fp, $client_ver ) |
public _ParseSearchResponse ( $response, $nreqs ) |
public $_error |
public $_fieldweights |
public $_filters |
public $_groupdistinct |
public $_groupsort |
public $_limit |
public $_maxquerytime |
public $_mode |
public $_timeout |