From eb2b986b6859e121d3f11f99e6c8604a5cbed7e1 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 25 Jul 2008 08:21:45 +0000 Subject: [PATCH] add sphinx docs git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@263491 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/sphinx/book.xml | 48 +++ reference/sphinx/configure.xml | 40 ++ reference/sphinx/constants.xml | 393 ++++++++++++++++++ reference/sphinx/examples.xml | 99 +++++ reference/sphinx/reference.xml | 31 ++ reference/sphinx/setup.xml | 52 +++ reference/sphinx/sphinxclient.xml | 66 +++ reference/sphinx/sphinxclient/addquery.xml | 94 +++++ .../sphinx/sphinxclient/buildexcerpts.xml | 136 ++++++ .../sphinx/sphinxclient/buildkeywords.xml | 86 ++++ reference/sphinx/sphinxclient/construct.xml | 47 +++ .../sphinx/sphinxclient/escapestring.xml | 66 +++ .../sphinx/sphinxclient/getlasterror.xml | 58 +++ .../sphinx/sphinxclient/getlastwarning.xml | 58 +++ reference/sphinx/sphinxclient/query.xml | 136 ++++++ .../sphinx/sphinxclient/resetfilters.xml | 55 +++ .../sphinx/sphinxclient/resetgroupby.xml | 52 +++ reference/sphinx/sphinxclient/runqueries.xml | 60 +++ .../sphinx/sphinxclient/setarrayresult.xml | 70 ++++ .../sphinx/sphinxclient/setconnecttimeout.xml | 74 ++++ .../sphinx/sphinxclient/setfieldweights.xml | 85 ++++ reference/sphinx/sphinxclient/setfilter.xml | 95 +++++ .../sphinxclient/setfilterfloatrange.xml | 109 +++++ .../sphinx/sphinxclient/setfilterrange.xml | 109 +++++ .../sphinx/sphinxclient/setgeoanchor.xml | 109 +++++ reference/sphinx/sphinxclient/setgroupby.xml | 103 +++++ .../sphinx/sphinxclient/setgroupdistinct.xml | 80 ++++ reference/sphinx/sphinxclient/setidrange.xml | 78 ++++ .../sphinx/sphinxclient/setindexweights.xml | 68 +++ reference/sphinx/sphinxclient/setlimits.xml | 99 +++++ .../sphinx/sphinxclient/setmatchmode.xml | 118 ++++++ .../sphinx/sphinxclient/setmaxquerytime.xml | 75 ++++ .../sphinx/sphinxclient/setrankingmode.xml | 105 +++++ reference/sphinx/sphinxclient/setretries.xml | 84 ++++ reference/sphinx/sphinxclient/setserver.xml | 76 ++++ reference/sphinx/sphinxclient/setsortmode.xml | 123 ++++++ .../sphinx/sphinxclient/updateattributes.xml | 85 ++++ 37 files changed, 3322 insertions(+) create mode 100644 reference/sphinx/book.xml create mode 100644 reference/sphinx/configure.xml create mode 100644 reference/sphinx/constants.xml create mode 100644 reference/sphinx/examples.xml create mode 100644 reference/sphinx/reference.xml create mode 100644 reference/sphinx/setup.xml create mode 100644 reference/sphinx/sphinxclient.xml create mode 100644 reference/sphinx/sphinxclient/addquery.xml create mode 100644 reference/sphinx/sphinxclient/buildexcerpts.xml create mode 100644 reference/sphinx/sphinxclient/buildkeywords.xml create mode 100644 reference/sphinx/sphinxclient/construct.xml create mode 100644 reference/sphinx/sphinxclient/escapestring.xml create mode 100644 reference/sphinx/sphinxclient/getlasterror.xml create mode 100644 reference/sphinx/sphinxclient/getlastwarning.xml create mode 100644 reference/sphinx/sphinxclient/query.xml create mode 100644 reference/sphinx/sphinxclient/resetfilters.xml create mode 100644 reference/sphinx/sphinxclient/resetgroupby.xml create mode 100644 reference/sphinx/sphinxclient/runqueries.xml create mode 100644 reference/sphinx/sphinxclient/setarrayresult.xml create mode 100644 reference/sphinx/sphinxclient/setconnecttimeout.xml create mode 100644 reference/sphinx/sphinxclient/setfieldweights.xml create mode 100644 reference/sphinx/sphinxclient/setfilter.xml create mode 100644 reference/sphinx/sphinxclient/setfilterfloatrange.xml create mode 100644 reference/sphinx/sphinxclient/setfilterrange.xml create mode 100644 reference/sphinx/sphinxclient/setgeoanchor.xml create mode 100644 reference/sphinx/sphinxclient/setgroupby.xml create mode 100644 reference/sphinx/sphinxclient/setgroupdistinct.xml create mode 100644 reference/sphinx/sphinxclient/setidrange.xml create mode 100644 reference/sphinx/sphinxclient/setindexweights.xml create mode 100644 reference/sphinx/sphinxclient/setlimits.xml create mode 100644 reference/sphinx/sphinxclient/setmatchmode.xml create mode 100644 reference/sphinx/sphinxclient/setmaxquerytime.xml create mode 100644 reference/sphinx/sphinxclient/setrankingmode.xml create mode 100644 reference/sphinx/sphinxclient/setretries.xml create mode 100644 reference/sphinx/sphinxclient/setserver.xml create mode 100644 reference/sphinx/sphinxclient/setsortmode.xml create mode 100644 reference/sphinx/sphinxclient/updateattributes.xml diff --git a/reference/sphinx/book.xml b/reference/sphinx/book.xml new file mode 100644 index 0000000000..8438fcd939 --- /dev/null +++ b/reference/sphinx/book.xml @@ -0,0 +1,48 @@ + + + + + Sphinx Client + Sphinx + + + &reftitle.intro; + + This extension provides bindings for Sphinx search client library. + Sphinx is a standalone search engine meant to provide fast, + size-efficient and relevant fulltext search functions to other + applications. Sphinx was specially designed to integrate well with + SQL databases and scripting languages. + Both Sphinx and its client library can be obtained from the + official site + + + + &reference.sphinx.setup; + &reference.sphinx.constants; + &reference.sphinx.examples; + &reference.sphinx.sphinxclient; + + + + + diff --git a/reference/sphinx/configure.xml b/reference/sphinx/configure.xml new file mode 100644 index 0000000000..04f57224e5 --- /dev/null +++ b/reference/sphinx/configure.xml @@ -0,0 +1,40 @@ + + + +
+ &reftitle.install; + + &pecl.info; + http://pecl.php.net/package/sphinx + + + If ./configure is having trouble finding the + libsphinxclient files (for example, it was installed into a custom + prefix directory), use ./configure + --with-sphinx=$PREFIX, where $PREFIX is installation prefix of + libsphinxclient. + +
+ + + diff --git a/reference/sphinx/constants.xml b/reference/sphinx/constants.xml new file mode 100644 index 0000000000..b8752e2075 --- /dev/null +++ b/reference/sphinx/constants.xml @@ -0,0 +1,393 @@ + + + + + &reftitle.constants; + &extension.constants; + + + + + SEARCHD_OK + (integer) + + + + + + + + + SEARCHD_ERROR + (integer) + + + + + + + + + SEARCHD_RETRY + (integer) + + + + + + + + + SEARCHD_WARNING + (integer) + + + + + + + + + SPH_MATCH_ALL + (integer) + + + + + + + + + SPH_MATCH_ANY + (integer) + + + + + + + + + SPH_MATCH_PHRASE + (integer) + + + + + + + + + SPH_MATCH_BOOLEAN + (integer) + + + + + + + + + SPH_MATCH_EXTENDED + (integer) + + + + + + + + + SPH_MATCH_FULLSCAN + (integer) + + + + + + + + + SPH_MATCH_EXTENDED2 + (integer) + + + + + + + + + SPH_RANK_PROXIMITY_BM25 + (integer) + + + + + + + + + SPH_RANK_BM25 + (integer) + + + + + + + + + SPH_RANK_NONE + (integer) + + + + + + + + + SPH_RANK_WORDCOUNT + (integer) + + + + + + + + + SPH_SORT_RELEVANCE + (integer) + + + + + + + + + SPH_SORT_ATTR_DESC + (integer) + + + + + + + + + SPH_SORT_ATTR_ASC + (integer) + + + + + + + + + SPH_SORT_TIME_SEGMENTS + (integer) + + + + + + + + + SPH_SORT_EXTENDED + (integer) + + + + + + + + + SPH_SORT_EXPR + (integer) + + + + + + + + + SPH_FILTER_VALUES + (integer) + + + + + + + + + SPH_FILTER_RANGE + (integer) + + + + + + + + + SPH_FILTER_FLOATRANGE + (integer) + + + + + + + + + SPH_ATTR_INTEGER + (integer) + + + + + + + + + SPH_ATTR_TIMESTAMP + (integer) + + + + + + + + + SPH_ATTR_ORDINAL + (integer) + + + + + + + + + SPH_ATTR_BOOL + (integer) + + + + + + + + + SPH_ATTR_FLOAT + (integer) + + + + + + + + + SPH_ATTR_MULTI + (integer) + + + + + + + + + SPH_GROUPBY_DAY + (integer) + + + + + + + + + SPH_GROUPBY_WEEK + (integer) + + + + + + + + + SPH_GROUPBY_MONTH + (integer) + + + + + + + + + SPH_GROUPBY_YEAR + (integer) + + + + + + + + + SPH_GROUPBY_ATTR + (integer) + + + + + + + + + SPH_GROUPBY_ATTRPAIR + (integer) + + + + + + + + + + + + diff --git a/reference/sphinx/examples.xml b/reference/sphinx/examples.xml new file mode 100644 index 0000000000..61386f3af1 --- /dev/null +++ b/reference/sphinx/examples.xml @@ -0,0 +1,99 @@ + + + + + &reftitle.examples; + + Basic usage example + +setServer("localhost", 6712); +$s->setMatchMode(SPH_MATCH_ANY); +$s->setMaxQueryTime(3); + +$result = $s->query("test"); + +var_dump($result); + +?> +]]> + + &example.outputs.similar; + + + 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) + } + } +} +]]> + + + + + + diff --git a/reference/sphinx/reference.xml b/reference/sphinx/reference.xml new file mode 100644 index 0000000000..5aedb68509 --- /dev/null +++ b/reference/sphinx/reference.xml @@ -0,0 +1,31 @@ + + + + + Sphinx &Functions; + + &reference.sphinx.entities.functions; + + + + + diff --git a/reference/sphinx/setup.xml b/reference/sphinx/setup.xml new file mode 100644 index 0000000000..78cfb14371 --- /dev/null +++ b/reference/sphinx/setup.xml @@ -0,0 +1,52 @@ + + + + + &reftitle.setup; + +
+ &reftitle.required; + + PECL/swish requires PHP 5.1.3 or newer. + +
+ + + &reference.sphinx.configure; + + + +
+ &reftitle.runtime; + &no.config; +
+ + +
+ &reftitle.resources; + &no.resource; +
+ +
+ + + diff --git a/reference/sphinx/sphinxclient.xml b/reference/sphinx/sphinxclient.xml new file mode 100644 index 0000000000..6922d554d6 --- /dev/null +++ b/reference/sphinx/sphinxclient.xml @@ -0,0 +1,66 @@ + + + + + The SphinxClient class + SphinxClient + + + + +
+ &reftitle.intro; + + The SphinxClient class provides object-oriented interface to Sphinx. + +
+ + +
+ &reftitle.classsynopsis; + + + + SphinxClient + + + + + SphinxClient + + + + + Methods + + + + +
+ +
+ + &reference.sphinx.entities.sphinxclient; + +
+ + diff --git a/reference/sphinx/sphinxclient/addquery.xml b/reference/sphinx/sphinxclient/addquery.xml new file mode 100644 index 0000000000..9f891ee22f --- /dev/null +++ b/reference/sphinx/sphinxclient/addquery.xml @@ -0,0 +1,94 @@ + + + + + + SphinxClient::addQuery + Add query to multi-query batch + + + + &reftitle.description; + + public intSphinxClient::addQuery + stringquery + stringindex + stringcomment + + + Adds query with the current settings to multi-query batch. This method + doesn't affect current settings (sorting, filtering, grouping etc.) in any way. + + + + + &reftitle.parameters; + + + + query + + + Query string. + + + + + index + + + An index name (or names). + + + + + comment + + + + + + + + + + + &reftitle.returnvalues; + + Returns an index in an array of results that will be returned + by call or false on error. + + + + + &reftitle.seealso; + + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/buildexcerpts.xml b/reference/sphinx/sphinxclient/buildexcerpts.xml new file mode 100644 index 0000000000..1ccedb628f --- /dev/null +++ b/reference/sphinx/sphinxclient/buildexcerpts.xml @@ -0,0 +1,136 @@ + + + + + + SphinxClient::buildExcerpts + Build text snippets + + + + &reftitle.description; + + public arraySphinxClient::buildExcerpts + arraydocs + stringindex + stringwords + arrayopts + + + Connects to searchd, requests it to generate excerpts (snippets) from the + given documents, and returns the results. + + + + + &reftitle.parameters; + + + + docs + + + Array of strings with documents' contents. + + + + + index + + + Index name. + + + + + words + + + Keywords to highlight. + + + + + opts + + + Associative array of additional highlighting options (see below). + + + + + + + Highlighting options + + + + Option + Description + + + + + "before_match" + A string to insert before a keyword match. Default is "<b>". + + + "after_match" + A string to insert after a keyword match. Default is "</b>". + + + "chunk_separator" + A string to insert between snippet chunks (passages). Default is " ... ". + + + "limit" + Maximum snippet size, in symbols (codepoints). Integer, default is 256. + + + "around" + How much words to pick around each matching keywords block. Integer, default is 5. + + + "exact_phrase" + Whether to highlight exact query phrase matches only instead of + individual keywords. Boolean, default is &false;. + + + "single_passage" + Whether to extract single best passage only. Boolean, default is &false;. + + + +
+
+
+ + + &reftitle.returnvalues; + + Returns array of snippets on success, or &false; on failure. + + + +
+ + diff --git a/reference/sphinx/sphinxclient/buildkeywords.xml b/reference/sphinx/sphinxclient/buildkeywords.xml new file mode 100644 index 0000000000..f5939aa676 --- /dev/null +++ b/reference/sphinx/sphinxclient/buildkeywords.xml @@ -0,0 +1,86 @@ + + + + + + SphinxClient::buildKeywords + Extract keywords from query + + + + &reftitle.description; + + public arraySphinxClient::buildKeywords + stringquery + stringindex + boolhits + + + Extracts keywords from query using tokenizer + settings for the given index, optionally with + per-keyword occurrence statistics. + + + + + &reftitle.parameters; + + + + query + + + A query to extract keywords from. + + + + + index + + + An index to get tokenizing settings and keyword occurrence statistics + from. + + + + + hits + + + A boolean flag to enable/disable keyword statistics generation. + + + + + + + + + &reftitle.returnvalues; + + Returns an array of associative arrays with per-keyword information. + + + + + + diff --git a/reference/sphinx/sphinxclient/construct.xml b/reference/sphinx/sphinxclient/construct.xml new file mode 100644 index 0000000000..a86a604c33 --- /dev/null +++ b/reference/sphinx/sphinxclient/construct.xml @@ -0,0 +1,47 @@ + + + + + + SphinxClient::__construct + Create a new SphinxClient object + + + + &reftitle.description; + + SphinxClient::__construct + + + + Creates a new SphinxClient object. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + + diff --git a/reference/sphinx/sphinxclient/escapestring.xml b/reference/sphinx/sphinxclient/escapestring.xml new file mode 100644 index 0000000000..6733c05101 --- /dev/null +++ b/reference/sphinx/sphinxclient/escapestring.xml @@ -0,0 +1,66 @@ + + + + + + SphinxClient::escapeString + Escape special characters + + + + &reftitle.description; + + public stringSphinxClient::escapeString + stringstring + + + Escapes characters that are treated as special operators by the query + language parser. + + + + + &reftitle.parameters; + + + + string + + + String to escape. + + + + + + + + + &reftitle.returnvalues; + + Returns escaped string. + + + + + + diff --git a/reference/sphinx/sphinxclient/getlasterror.xml b/reference/sphinx/sphinxclient/getlasterror.xml new file mode 100644 index 0000000000..e140dc9515 --- /dev/null +++ b/reference/sphinx/sphinxclient/getlasterror.xml @@ -0,0 +1,58 @@ + + + + + + SphinxClient::getLastError + Get the last error message + + + + &reftitle.description; + + public stringSphinxClient::getLastError + + + + Returns string with the last error message. If there were no errors during + the previous API call, empty string is returned. This method doesn't reset + the error message, so you can safely call it several times. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/getlastwarning.xml b/reference/sphinx/sphinxclient/getlastwarning.xml new file mode 100644 index 0000000000..381f4c4c1a --- /dev/null +++ b/reference/sphinx/sphinxclient/getlastwarning.xml @@ -0,0 +1,58 @@ + + + + + + SphinxClient::getLastWarning + Get the last warning + + + + &reftitle.description; + + public stringSphinxClient::getLastWarning + + + + Returns last warning message. If there were no warnings during + the previous API call, empty string is returned. This method doesn't reset + the warning, so you can safely call it several times. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/query.xml b/reference/sphinx/sphinxclient/query.xml new file mode 100644 index 0000000000..b3f9d606d9 --- /dev/null +++ b/reference/sphinx/sphinxclient/query.xml @@ -0,0 +1,136 @@ + + + + + + SphinxClient::query + Execute search query + + + + &reftitle.description; + + public arraySphinxClient::query + stringquery + stringindex + stringcomment + + + Connects to searchd server, runs the given search query with the current settings, + obtains and returns the result set. + + + + + &reftitle.parameters; + + + + query + + + Query string. + + + + + index + + + An index name (or names). + + + + + comment + + + + + + + + + + + &reftitle.returnvalues; + + 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: + + Result set structure + + + + 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 + + + +
+
+
+ + + &reftitle.seealso; + + + + + + + + +
+ + diff --git a/reference/sphinx/sphinxclient/resetfilters.xml b/reference/sphinx/sphinxclient/resetfilters.xml new file mode 100644 index 0000000000..9c617d626a --- /dev/null +++ b/reference/sphinx/sphinxclient/resetfilters.xml @@ -0,0 +1,55 @@ + + + + + + SphinxClient::resetFilters + Clear all filters + + + + &reftitle.description; + + public voidSphinxClient::resetFilters + + + + Clears all currently set filters. This call is normally required when + using multi-queries. You might want to set different filters for different + queries in the batch. To do that, you should call + SphinxClient::resetFilters() and add new filters using + the respective calls. + + + + + &reftitle.seealso; + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/resetgroupby.xml b/reference/sphinx/sphinxclient/resetgroupby.xml new file mode 100644 index 0000000000..7a7ea5d364 --- /dev/null +++ b/reference/sphinx/sphinxclient/resetgroupby.xml @@ -0,0 +1,52 @@ + + + + + + SphinxClient::resetGroupBy + Clear all group-by settings + + + + &reftitle.description; + + public voidSphinxClient::resetGroupBy + + + + Clears all currently group-by settings, and disables group-by. + This call is normally required only when using multi-queries. + + + + + &reftitle.seealso; + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/runqueries.xml b/reference/sphinx/sphinxclient/runqueries.xml new file mode 100644 index 0000000000..0ff2b2106c --- /dev/null +++ b/reference/sphinx/sphinxclient/runqueries.xml @@ -0,0 +1,60 @@ + + + + + + SphinxClient::runQueries + Run a batch of search queries + + + + &reftitle.description; + + public arraySphinxClient::runQueries + + + + Connects to searchd, runs a batch of all queries added using , obtains and returns the result sets. + + + + + &reftitle.returnvalues; + + Returns &false; on failure and array of result sets on success. + + + + + &reftitle.seealso; + + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setarrayresult.xml b/reference/sphinx/sphinxclient/setarrayresult.xml new file mode 100644 index 0000000000..f5e55f3273 --- /dev/null +++ b/reference/sphinx/sphinxclient/setarrayresult.xml @@ -0,0 +1,70 @@ + + + + + + SphinxClient::setArrayResult + Change the format of result set array + + + + &reftitle.description; + + public boolSphinxClient::setArrayResult + boolarray_result + + + Controls the format of search results set arrays (whether matches should + be returned as an array or a hash). + If array_result is &false; (default value), matches + are returned as a hash with document IDs as keys, and other information (weight, + attributes) as values. If array_result is &true;, matches + are eturned as a plain array with complete per-match information including + document IDs. + + + + + &reftitle.parameters; + + + + array_result + + + + + + + + + + + &reftitle.returnvalues; + + Always returns &true;. + + + + + + diff --git a/reference/sphinx/sphinxclient/setconnecttimeout.xml b/reference/sphinx/sphinxclient/setconnecttimeout.xml new file mode 100644 index 0000000000..1daac3885f --- /dev/null +++ b/reference/sphinx/sphinxclient/setconnecttimeout.xml @@ -0,0 +1,74 @@ + + + + + + SphinxClient::setConnectTimeout + Set connection timeout + + + + &reftitle.description; + + public boolSphinxClient::setConnectTimeout + floattimeout + + + Sets connection timeout (in seconds) for searchd connection. + + + + + &reftitle.parameters; + + + + timeout + + + Timeout in seconds. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setfieldweights.xml b/reference/sphinx/sphinxclient/setfieldweights.xml new file mode 100644 index 0000000000..e6307c15c0 --- /dev/null +++ b/reference/sphinx/sphinxclient/setfieldweights.xml @@ -0,0 +1,85 @@ + + + + + + SphinxClient::setFieldWeights + Set field weights + + + + &reftitle.description; + + public boolSphinxClient::setFieldWeights + arrayweights + + + Binds per-field weights by name. + + + Match ranking can be affected by per-field weights. See Sphinx documentation for an explanation + on how phrase proximity ranking is affected. This call lets you specify + non-default weights for full-text fields. + + + The weights must be positive 32-bit integers, so be careful not to hit + 32-bit integer maximum. The final weight is a 32-bit integer too. + Default weight value is 1. Unknown field names are silently ignored. + + + + + &reftitle.parameters; + + + + weights + + + Associative array of field names and field weights. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setfilter.xml b/reference/sphinx/sphinxclient/setfilter.xml new file mode 100644 index 0000000000..cb1a603d56 --- /dev/null +++ b/reference/sphinx/sphinxclient/setfilter.xml @@ -0,0 +1,95 @@ + + + + + + SphinxClient::setFilter + Add new integer values set filter + + + + &reftitle.description; + + public boolSphinxClient::setFilter + stringattribute + arrayvalues + boolexclude + + + Adds new integer values set filter to the existing list of filters. + + + + + &reftitle.parameters; + + + + attribute + + + An attribute name. + + + + + values + + + Plain array of integer values. + + + + + exclude + + + If set to &true;, matching documents are excluded from the result set. + Defaults to &false;. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setfilterfloatrange.xml b/reference/sphinx/sphinxclient/setfilterfloatrange.xml new file mode 100644 index 0000000000..b4ab6e51c5 --- /dev/null +++ b/reference/sphinx/sphinxclient/setfilterfloatrange.xml @@ -0,0 +1,109 @@ + + + + + + SphinxClient::setFilterFloatRange + Add new float range filter + + + + &reftitle.description; + + public boolSphinxClient::setFilterFloatRange + stringattribute + floatmin + floatmax + boolexclude + + + Adds new float range filter to the existing list of filters. + Only those documents which have attribute + value stored in the index between min and + max (including values that are exactly equal + to min or max) will + be matched (or rejected, if exclude is &true;). + + + + + &reftitle.parameters; + + + + attribute + + + An attribute name. + + + + + min + + + Minimum value. + + + + + max + + + Maximum value. + + + + + exclude + + + If set to &true;, matching documents are excluded from the result set. + Defaults to &false;. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setfilterrange.xml b/reference/sphinx/sphinxclient/setfilterrange.xml new file mode 100644 index 0000000000..b3cb110f8d --- /dev/null +++ b/reference/sphinx/sphinxclient/setfilterrange.xml @@ -0,0 +1,109 @@ + + + + + + SphinxClient::setFilterRange + Add new integer range filter + + + + &reftitle.description; + + public boolSphinxClient::setFilterRange + stringattribute + intmin + intmax + boolexclude + + + Adds new integer range filter to the existing list of filters. + Only those documents which have attribute + value stored in the index between min and + max (including values that are exactly equal + to min or max) will + be matched (or rejected, if exclude is &true;). + + + + + &reftitle.parameters; + + + + attribute + + + An attribute name. + + + + + min + + + Minimum value. + + + + + max + + + Maximum value. + + + + + exclude + + + If set to &true;, matching documents are excluded from the result set. + Defaults to &false;. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setgeoanchor.xml b/reference/sphinx/sphinxclient/setgeoanchor.xml new file mode 100644 index 0000000000..ccf0eea094 --- /dev/null +++ b/reference/sphinx/sphinxclient/setgeoanchor.xml @@ -0,0 +1,109 @@ + + + + + + SphinxClient::setGeoAnchor + Set anchor point for a geosphere distance calculations + + + + &reftitle.description; + + public boolSphinxClient::setGeoAnchor + stringattrlat + stringattrlong + floatlatitude + floatlongitude + + + Sets anchor point for a geosphere distance (geodistance) calculations + and enables them. + + + Once an anchor point is set, you can use magic "@geodist" attribute name in + your filters and/or sorting expressions. + + + + + &reftitle.parameters; + + + + attrlat + + + Name of a latitude attribute. + + + + + attrlong + + + Name of a longitude attribute. + + + + + latitude + + + Anchor latitude in radians. + + + + + longitude + + + Anchor longitude in radians. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setgroupby.xml b/reference/sphinx/sphinxclient/setgroupby.xml new file mode 100644 index 0000000000..d1e158c49f --- /dev/null +++ b/reference/sphinx/sphinxclient/setgroupby.xml @@ -0,0 +1,103 @@ + + + + + + SphinxClient::setGroupBy + Set grouping attribute + + + + &reftitle.description; + + public boolSphinxClient::setGroupBy + stringattribute + intfunc + stringgroupsort + + + Sets grouping attribute, function, and group sorting mode, and enables + grouping. + + + Grouping feature is very similar to GROUP BY clause in SQL. + Results produced by this function call are going to be the same as produced + by the following pseudo code: + SELECT ... GROUP BY $func($attribute) ORDER BY $groupsort. + + + + + &reftitle.parameters; + + + + attribute + + + A string containing group-by attribute name. + + + + + func + + + Constant, which sets a function applied to the attribute value in order + to compute group-by key. + + + + + groupsort + + + An optional clause controlling how the groups are sorted. + Defaults to "@group desc". + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setgroupdistinct.xml b/reference/sphinx/sphinxclient/setgroupdistinct.xml new file mode 100644 index 0000000000..67aa344492 --- /dev/null +++ b/reference/sphinx/sphinxclient/setgroupdistinct.xml @@ -0,0 +1,80 @@ + + + + + + SphinxClient::setGroupDistinct + Set attribute name for per-group distinct values count calculations + + + + &reftitle.description; + + public boolSphinxClient::setGroupDistinct + stringattribute + + + Sets attribute name for per-group distinct values count calculations. Only + available for grouping queries. For each group, all values of + attribute will be stored, then the amount of + distinct values will be calculated and returned to the client. This feature + is similar to COUNT(DISTINCT) clause in SQL. + + + + + &reftitle.parameters; + + + + attribute + + + A string containing group-by attribute name. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setidrange.xml b/reference/sphinx/sphinxclient/setidrange.xml new file mode 100644 index 0000000000..b1a6735e78 --- /dev/null +++ b/reference/sphinx/sphinxclient/setidrange.xml @@ -0,0 +1,78 @@ + + + + + + SphinxClient::setIDRange + Set a range of accepted document IDs + + + + &reftitle.description; + + public boolSphinxClient::setIDRange + intmin + intmax + + + Sets an accepted range of document IDs. Default range is from 0 to 0, i.e. + no limit. Only those records that have document ID between + min and max + (including IDs exactly equal to min or + max) will be matched. + + + + + &reftitle.parameters; + + + + min + + + Minimum ID value. + + + + + max + + + Maximum ID value. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/sphinx/sphinxclient/setindexweights.xml b/reference/sphinx/sphinxclient/setindexweights.xml new file mode 100644 index 0000000000..2dda0ce0c9 --- /dev/null +++ b/reference/sphinx/sphinxclient/setindexweights.xml @@ -0,0 +1,68 @@ + + + + + + SphinxClient::setIndexWeights + Set per-index weights + + + + &reftitle.description; + + public boolSphinxClient::setIndexWeights + arrayweights + + + Sets per-index weights and enables weighted summing of match weights across + different indexes. + + + + + &reftitle.parameters; + + + + weights + + + An associative array mapping string index names to integer + weights. Default is empty array, i.e. weighting summing is disabled. + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/sphinx/sphinxclient/setlimits.xml b/reference/sphinx/sphinxclient/setlimits.xml new file mode 100644 index 0000000000..dc3050ea5a --- /dev/null +++ b/reference/sphinx/sphinxclient/setlimits.xml @@ -0,0 +1,99 @@ + + + + + + SphinxClient::setLimits + Set offset and limit of the result set + + + + &reftitle.description; + + public boolSphinxClient::setLimits + intoffset + intlimit + intmax + intcutoff + + + Sets offset into server-side result set and amount + of matches to return to client starting from that offset + (limit). Can additionally control maximum + server-side result set size for current query + (max_matches) and the threshold amount of matches + to stop searching at (cutoff). + + + + + &reftitle.parameters; + + + + offset + + + Result set offset. + + + + + limit + + + Amount of matches to return. + + + + + max_matches + + + Controls how much matches searchd will keep in RAM while searching. + + + + + cutoff + + + Used for advanced performance control. It tells searchd to forcibly + stop search query once cutoff matches have been + found and processed. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/sphinx/sphinxclient/setmatchmode.xml b/reference/sphinx/sphinxclient/setmatchmode.xml new file mode 100644 index 0000000000..a368e4e588 --- /dev/null +++ b/reference/sphinx/sphinxclient/setmatchmode.xml @@ -0,0 +1,118 @@ + + + + + + SphinxClient::setMatchMode + Set full-text query matching mode + + + + &reftitle.description; + + public boolSphinxClient::setMatchMode + intmode + + + Sets full-text query matching mode. mode is one of + the constants listed below. + + Match modes + + + + Constant + Description + + + + + SPH_MATCH_ALL + Match all query words (default mode). + + + SPH_MATCH_ANY + Match any of query words. + + + SPH_MATCH_PHRASE + Match query as a phrase, requiring perfect match. + + + SPH_MATCH_BOOLEAN + Match query as a boolean expression. + + + SPH_MATCH_EXTENDED + Match query as an expression in Sphinx internal query language. + + + SPH_MATCH_FULLSCAN + Enables fullscan. + + + SPH_MATCH_EXTENDED2 + The same as SPH_MATCH_EXTENDED plus ranking + and quorum searching support. + + + +
+
+
+ + + &reftitle.parameters; + + + + mode + + + Matching mode. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + +
+ + diff --git a/reference/sphinx/sphinxclient/setmaxquerytime.xml b/reference/sphinx/sphinxclient/setmaxquerytime.xml new file mode 100644 index 0000000000..fa5b1e8db2 --- /dev/null +++ b/reference/sphinx/sphinxclient/setmaxquerytime.xml @@ -0,0 +1,75 @@ + + + + + + SphinxClient::setMaxQueryTime + Set maximum query time + + + + &reftitle.description; + + public boolSphinxClient::setMaxQueryTime + stringqtime + + + Sets maximum search query time, in milliseconds. qtime must be a + non-negative integer. Default value is 0, i.e. no limit. + + + + + &reftitle.parameters; + + + + qtime + + + Maximum query time, in milliseconds. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + diff --git a/reference/sphinx/sphinxclient/setrankingmode.xml b/reference/sphinx/sphinxclient/setrankingmode.xml new file mode 100644 index 0000000000..ed0a4ce3fa --- /dev/null +++ b/reference/sphinx/sphinxclient/setrankingmode.xml @@ -0,0 +1,105 @@ + + + + + + SphinxClient::setRankingMode + Set ranking mode + + + + &reftitle.description; + + public boolSphinxClient::setRankingMode + intranker + + + Sets ranking mode. Only available in + SPH_MATCH_EXTENDED2 matching mode. + + Ranking modes + + + + Constant + Description + + + + + SPH_RANK_PROXIMITY_BM25 + Default ranking mode which uses both proximity and BM25 + ranking. + + + SPH_RANK_BM25 + Statistical ranking mode which uses BM25 ranking only (similar + to most of other full-text engines). This mode is faster, but may result + in worse quality on queries which contain more than 1 keyword. + + + SPH_RANK_NONE + Disables ranking. This mode is the fastest. It is essentially + equivalent to boolean searching, a weight of 1 is assigned to all + matches. + + + +
+
+
+ + + &reftitle.parameters; + + + + ranker + + + Ranking mode. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + +
+ + diff --git a/reference/sphinx/sphinxclient/setretries.xml b/reference/sphinx/sphinxclient/setretries.xml new file mode 100644 index 0000000000..4f1b149b83 --- /dev/null +++ b/reference/sphinx/sphinxclient/setretries.xml @@ -0,0 +1,84 @@ + + + + + + SphinxClient::setRetries + Set retry count and delay + + + + &reftitle.description; + + public boolSphinxClient::setRetries + intcount + intdelay + + + Sets distributed retry count and delay. + + + On temporary failures searchd will attempt up to + count retries per agent. + delay is the delay between the retries, + in milliseconds. Retries are disabled by default. + Note that this call will not make the API itself retry + on temporary failure; it only tells searchd to do so. + + + + + &reftitle.parameters; + + + + count + + + Number of retries. + + + + + + + delay + + + Delay between retries, in milliseconds. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/sphinx/sphinxclient/setserver.xml b/reference/sphinx/sphinxclient/setserver.xml new file mode 100644 index 0000000000..75ac2d5d75 --- /dev/null +++ b/reference/sphinx/sphinxclient/setserver.xml @@ -0,0 +1,76 @@ + + + + + + SphinxClient::setServer + Set searchd host and port + + + + &reftitle.description; + + public boolSphinxClient::setServer + stringserver + intport + + + Sets searchd host name and TCP port. All subsequent requests will use the + new host and port settings. Default host and port are 'localhost' and 3312, + respectively. + + + + + &reftitle.parameters; + + + + server + + + IP or hostname. + + + + + port + + + Port number. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + + diff --git a/reference/sphinx/sphinxclient/setsortmode.xml b/reference/sphinx/sphinxclient/setsortmode.xml new file mode 100644 index 0000000000..d86977ea29 --- /dev/null +++ b/reference/sphinx/sphinxclient/setsortmode.xml @@ -0,0 +1,123 @@ + + + + + + SphinxClient::setSortMode + Set matches sorting mode + + + + &reftitle.description; + + public boolSphinxClient::setSortMode + intmode + stringsortby + + + Sets matches sorting mode. See available modes below. + + Sorting modes + + + + Constant + Description + + + + + SPH_SORT_RELEVANCE + Sort by relevance in descending order (best matches first). + + + SPH_SORT_ATTR_DESC + Sort by an attribute in descending order (bigger attribute + values first). + + + SPH_SORT_ATTR_ASC + Sort by an attribute in ascending order (smaller attribute + values first). + + + SPH_SORT_TIME_SEGMENTS + Sort by time segments (last hour/day/week/month) in descending + order, and then by relevance in descending order. + + + SPH_SORT_EXTENDED + Sort by SQL-like combination of columns in ASC/DESC order. + + + SPH_SORT_EXPR + Sort by an arithmetic expression. + + + +
+
+
+ + + &reftitle.parameters; + + + + mode + + + Sorting mode. + + + + + sortby + + + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + +
+ + diff --git a/reference/sphinx/sphinxclient/updateattributes.xml b/reference/sphinx/sphinxclient/updateattributes.xml new file mode 100644 index 0000000000..d97e6c19ea --- /dev/null +++ b/reference/sphinx/sphinxclient/updateattributes.xml @@ -0,0 +1,85 @@ + + + + + + SphinxClient::updateAttributes + Updates document attributes + + + + &reftitle.description; + + public intSphinxClient::updateAttributes + stringindex + arrayattributes + arrayvalues + + + Instantly updates given attribute values in given documents. + + + + + &reftitle.parameters; + + + + index + + + Name of the index (or indexes) to be updated. + + + + + attributes + + + Array of attribute names, listing attributes that are updated. + + + + + values + + + Associative array containing document IDs as keys and array of + attribute values as values. + + + + + + + + + &reftitle.returnvalues; + + Returns number of actually updated documents (0 or more) on success, or + &false; on failure. + + + + + +