Communication interface to the Sphinx searchd. More...
#include <sphinxclient.h>
Public Member Functions | |
Client_t (const ConnectionConfig_t &connectionSettings) | |
void | query (const std::string &query, const SearchConfig_t &queryAttr, Response_t &response) |
send a search query to the searchd | |
void | query (const MultiQuery_t &query, std::vector< Response_t > &response) |
send a search multi-query to the searchd | |
void | query (const MultiQueryOpt_t &query, std::vector< Response_t > &response) |
send a search multi-query optimised to the searchd | |
void | updateAttributes (const std::string &index, const AttributeUpdates_t &at) |
send a update command to searchd | |
std::vector< KeywordResult_t > | getKeywords (const std::string &index, const std::string &query, bool getWordStatistics=false) |
send a keywords request to searchd | |
Protected Attributes | |
ConnectionConfig_t | connection |
Communication interface to the Sphinx searchd.
this is the main class. It contains communication methods and response structure
std::vector<KeywordResult_t> Sphinx::Client_t::getKeywords | ( | const std::string & | index, | |
const std::string & | query, | |||
bool | getWordStatistics = false | |||
) |
send a keywords request to searchd
Send a request to analyze query words. Run tokenizer and normalization.
index | name of index to use tokenizer settings from. Does not support wildcards (*). | |
query | query to analyze. | |
getWordStatistics | when true, fetch also total word docs/hits |
void Sphinx::Client_t::query | ( | const MultiQuery_t & | query, | |
std::vector< Response_t > & | response | |||
) |
send a search multi-query to the searchd
Sends a search multi-query to the sphinx searchd and fills the response structure vector. On exception the content of the response is undefined, any previous structure content is invalidated anyway.
query | initialized MultiQuery_t object witg queries added | |
response | output parameter - response structure |
SphinxClientError_t | on any communication or parsing error |
void Sphinx::Client_t::query | ( | const std::string & | query, | |
const SearchConfig_t & | queryAttr, | |||
Response_t & | response | |||
) |
send a search query to the searchd
Sends a search query to the sphinx searchd and fills the response structure. On exception the content of the response is undefined, any previous structure content is invalidated anyway.
query | list of words to search for | |
queryAttr | query configuration | |
response | output parameter - response structure |
SphinxClientError_t | on any communication or parsing error |
void Sphinx::Client_t::query | ( | const MultiQueryOpt_t & | query, | |
std::vector< Response_t > & | response | |||
) |
send a search multi-query optimised to the searchd
Sends an optimized multi-query to the sphinx searchd and fills the response structure vector. On exception the content of the response is undefined, any previous structure content is invalidated anyway.
Multiquery divides queries into similar multiquery-efficient groups. These groups are sent simoultanously in parrallel connections to searchd.
query | initialized MultiQueryOpt_t object witg queries added | |
response | output parameter - response structure |
SphinxClientError_t | on any communication or parsing error |
void Sphinx::Client_t::updateAttributes | ( | const std::string & | index, | |
const AttributeUpdates_t & | at | |||
) |
send a update command to searchd
Sends a command to update attributes in sphinx searchd loaded indexes. Works only for externally stored docinfo. Currently supported attribute types are uint32_t and float.
index | name of index to be updated. Does not support wildcard (*) | |
at | list of attributes and their values to update in documents |
SphinxClientError_t | on any communication or parsing error |