Public Member Functions | Protected Attributes

Sphinx::Client_t Class Reference

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_tgetKeywords (const std::string &index, const std::string &query, bool getWordStatistics=false)
 send a keywords request to searchd

Protected Attributes

ConnectionConfig_t connection

Detailed Description

Communication interface to the Sphinx searchd.

this is the main class. It contains communication methods and response structure


Member Function Documentation

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.

Parameters:
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
Returns:
tokenized and normalized words
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.

Parameters:
query initialized MultiQuery_t object witg queries added
response output parameter - response structure
Exceptions:
SphinxClientError_t on any communication or parsing error
See also:
MultiQuery_t
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.

Parameters:
query list of words to search for
queryAttr query configuration
response output parameter - response structure
Exceptions:
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.

See also:
QueryMachine_t
Parameters:
query initialized MultiQueryOpt_t object witg queries added
response output parameter - response structure
Exceptions:
SphinxClientError_t on any communication or parsing error
See also:
MultiQueryOpt_t
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.

Parameters:
index name of index to be updated. Does not support wildcard (*)
at list of attributes and their values to update in documents
Exceptions:
SphinxClientError_t on any communication or parsing error
See also:
AttributeUpdates_t

The documentation for this class was generated from the following file: