hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
|
#include <SphinxSearcher.hpp>
Public Member Functions | |
SphinxSearcher (SphinxFunctionalObject &fObj, bool startSearchd=false, bool stopSearchd_=false) | |
virtual | ~SphinxSearcher (void) |
bool | easyStart (int matchMode=SPH_MATCH_EXTENDED2, int sortMode=SPH_SORT_RELEVANCE, int rankingMode=SPH_RANK_DEFAULT, const std::string &rankexpr="") |
bool | startSearchd (void) |
bool | stopSearchd (void) |
bool | isActiveSearchd (void) |
bool | isNeedStopSearchd (void) const |
bool | isConnected (void) const |
bool | isStoppedSearchd (void) const |
std::string | Process (const std::string &json) |
SphinxOutputJsonMessage | Process (SphinxInputJsonMessage &inputJsonMessage) |
bool | open (void) |
bool | close (void) |
void | setServerHost (const std::string &serverHost_) |
std::string | getServerHost (void) const |
void | setServerPort (int serverPort_) |
int | getServerPort (void) const |
bool | setFieldWeights (std::vector< std::pair< std::string, int > > &Vec) |
bool | setIndexWeights (std::vector< std::pair< std::string, int > > &Vec) |
void | getFieldWeights (std::vector< std::pair< std::string, int > > &Vec) |
void | getIndexWeights (std::vector< std::pair< std::string, int > > &Vec) |
bool | addField (const std::string &name, int weight=0) |
bool | setField (const std::string &name, int weight) |
bool | delField (const std::string &name) |
bool | addIndexFile (const std::string &name, int weight=0) |
bool | setIndexFile (const std::string &name, int weight) |
bool | delIndexFile (const std::string &name) |
bool | isExistField (const std::string &name) |
bool | isExistIndexFile (const std::string &name) |
int | getFieldWeight (const std::string &name) |
int | getIndexWeight (const std::string &name) |
bool | setMatchMode (int mode) |
bool | setSortMode (int mode, const std::string &sortby="") |
bool | setRankingMode (int ranker, const std::string &rankexpr="") |
size_t | getFieldsCount (void) const |
size_t | getIndexesCount (void) const |
bool | setIndexFileName (const std::string &indexFileName_) |
std::string | getIndexFileName (void) const |
void | setTimeoutedRequests (unsigned long long timeoutedRequests_) |
unsigned long long | getTimeoutedRequests (void) const |
void | resetTimeoutedRequests (void) |
void | setDefaultRequestTimeout (unsigned long defaultRequestTimeout_) |
unsigned long | getDefaultRequestTimeout (void) const |
void | resizeResultData (size_t matchesCount, size_t attributesCount) |
bool | searchDocument (const std::string &query, SphinxResultDataMemoryManager &resultMemoryManager, SphinxRequestInfo &requestInfo) |
Public Member Functions inherited from HCE::sphinx::SphinxSearchInterface | |
SphinxSearchInterface (void) | |
virtual | ~SphinxSearchInterface (void) |
void | setErrorMsg (const std::string &errorMsg_) |
std::string | getErrorMsg (void) const |
void | setErrorCode (unsigned int errorCode_) |
unsigned int | getErrorCode (void) const |
void | isError (bool isError_) |
bool | isError (void) const |
Protected Member Functions | |
bool | addFilter (const std::string &attrName, long long value, bool exclude=false) |
bool | addFilter (const std::string &attrName, std::vector< long long > &values, bool exclude=false) |
bool | addFilterRange (const std::string &attrName, long long umin, long long umax, bool exclude=false) |
bool | addFilterFloatRange (const std::string &attrName, float fmin, float fmax, bool exclude=false) |
void | resetFilters (void) |
void | setMaxResultsNumber (unsigned int maxResultsNumber) throw (Poco::Exception) |
void | setLimits (unsigned int offset, unsigned int limit, unsigned int maxMatches, unsigned int cutoff=0) throw (Poco::Exception) |
void | applyFilter (Poco::SharedPtr< SphinxFilter > pFilter) throw (Poco::Exception) |
void | setMaxQueryTime (unsigned long maxQueryTime) throw (Poco::Exception) |
std::string | makeSearchCommand (const std::string &json) throw (Poco::Exception, std::exception) |
void | cleanup (char **&names, int *&weights, size_t &count) |
bool | setWeights (char **&names, int *&weights, size_t &count, std::vector< std::pair< std::string, int > > &Vec) |
void | getWeights (char **&names, int *&weights, size_t &count, std::vector< std::pair< std::string, int > > &Vec) |
void | setAllowedFields (std::vector< std::string > &queryExtendedFields) |
std::set< std::string > & | getAlloedFields (void) |
bool | isAllowedFields (const std::string &extendedFieldName) |
void | setFullSchemaNames (std::vector< std::string > &schemaNames) |
std::set< std::string > & | getFullSchemaNames (void) |
bool | isExistSchemaNames (const std::string &schemaName) |
Static Protected Member Functions | |
static std::vector< std::pair < std::string, int > >::iterator | find (std::vector< std::pair< std::string, int > > &Vec, const std::string &name) |
Protected Attributes | |
SphinxFunctionalObject & | fObj |
CustomMessage & | message |
std::string | serverHost |
int | serverPort |
std::string | indexFileName |
bool | _StopSearchd |
bool | _isConnected |
bool | _isStoppedSearchd |
unsigned long long | timeoutedRequests |
unsigned long | defaultRequestTimeout |
std::set< std::string > | allowedFields |
std::set< std::string > | fullSchemaNames |
SphinxRequestInfo | requestInfo |
SphinxResultData | resultData |
SphinxResultDataSerializator | resultSerializator |
SphinxResultDataMemoryManager | resultMemoryManager |
Protected Attributes inherited from HCE::sphinx::SphinxSearchInterface | |
std::string | errorMsg |
unsigned int | errorCode |
bool | _isError |
Friends | |
class | SphinxFunctionalObject |
Additional Inherited Members | |
Static Public Member Functions inherited from HCE::sphinx::SphinxSearchInterface | |
static bool | insensitiveCompare (const std::string &lhs, const std::string &rhs) |
static size_t | getTimeInterval (timeval &start, timeval &stop) |
Definition at line 35 of file SphinxSearcher.hpp.
|
explicit |
Definition at line 26 of file SphinxSearcher.cpp.
|
virtual |
bool HCE::sphinx::SphinxSearcher::addField | ( | const std::string & | name, |
int | weight = 0 |
||
) |
|
protected |
Definition at line 860 of file SphinxSearcher.cpp.
|
protected |
Definition at line 865 of file SphinxSearcher.cpp.
|
protected |
Definition at line 884 of file SphinxSearcher.cpp.
|
protected |
Definition at line 879 of file SphinxSearcher.cpp.
bool HCE::sphinx::SphinxSearcher::addIndexFile | ( | const std::string & | name, |
int | weight = 0 |
||
) |
|
protected |
Definition at line 213 of file SphinxSearcher.cpp.
|
protected |
bool HCE::sphinx::SphinxSearcher::close | ( | void | ) |
bool HCE::sphinx::SphinxSearcher::delField | ( | const std::string & | name | ) |
bool HCE::sphinx::SphinxSearcher::delIndexFile | ( | const std::string & | name | ) |
bool HCE::sphinx::SphinxSearcher::easyStart | ( | int | matchMode = SPH_MATCH_EXTENDED2 , |
int | sortMode = SPH_SORT_RELEVANCE , |
||
int | rankingMode = SPH_RANK_DEFAULT , |
||
const std::string & | rankexpr = "" |
||
) |
Definition at line 267 of file SphinxSearcher.cpp.
|
staticprotected |
|
inlineprotected |
Definition at line 172 of file SphinxSearcher.hpp.
|
inline |
|
inline |
Definition at line 121 of file SphinxSearcher.hpp.
int HCE::sphinx::SphinxSearcher::getFieldWeight | ( | const std::string & | name | ) |
void HCE::sphinx::SphinxSearcher::getFieldWeights | ( | std::vector< std::pair< std::string, int > > & | Vec | ) |
Definition at line 460 of file SphinxSearcher.cpp.
|
inlineprotected |
Definition at line 176 of file SphinxSearcher.hpp.
|
inline |
Definition at line 122 of file SphinxSearcher.hpp.
|
inline |
int HCE::sphinx::SphinxSearcher::getIndexWeight | ( | const std::string & | name | ) |
void HCE::sphinx::SphinxSearcher::getIndexWeights | ( | std::vector< std::pair< std::string, int > > & | Vec | ) |
Definition at line 465 of file SphinxSearcher.cpp.
|
inline |
|
inline |
|
inline |
|
protected |
bool HCE::sphinx::SphinxSearcher::isActiveSearchd | ( | void | ) |
Definition at line 178 of file SphinxSearcher.cpp.
|
protected |
|
inline |
bool HCE::sphinx::SphinxSearcher::isExistField | ( | const std::string & | name | ) |
bool HCE::sphinx::SphinxSearcher::isExistIndexFile | ( | const std::string & | name | ) |
|
protected |
Definition at line 73 of file SphinxSearcher.cpp.
|
inline |
|
inline |
|
protected |
Definition at line 946 of file SphinxSearcher.cpp.
bool HCE::sphinx::SphinxSearcher::open | ( | void | ) |
Definition at line 322 of file SphinxSearcher.cpp.
|
virtual |
Implements HCE::sphinx::SphinxSearchInterface.
Definition at line 894 of file SphinxSearcher.cpp.
|
virtual |
Implements HCE::sphinx::SphinxSearchInterface.
Definition at line 1080 of file SphinxSearcher.cpp.
|
protected |
Definition at line 889 of file SphinxSearcher.cpp.
|
inline |
void HCE::sphinx::SphinxSearcher::resizeResultData | ( | size_t | matchesCount, |
size_t | attributesCount | ||
) |
Definition at line 49 of file SphinxSearcher.cpp.
bool HCE::sphinx::SphinxSearcher::searchDocument | ( | const std::string & | query, |
SphinxResultDataMemoryManager & | resultMemoryManager, | ||
SphinxRequestInfo & | requestInfo | ||
) |
|
protected |
Definition at line 54 of file SphinxSearcher.cpp.
|
inline |
bool HCE::sphinx::SphinxSearcher::setField | ( | const std::string & | name, |
int | weight | ||
) |
bool HCE::sphinx::SphinxSearcher::setFieldWeights | ( | std::vector< std::pair< std::string, int > > & | Vec | ) |
Definition at line 421 of file SphinxSearcher.cpp.
|
protected |
bool HCE::sphinx::SphinxSearcher::setIndexFile | ( | const std::string & | name, |
int | weight | ||
) |
bool HCE::sphinx::SphinxSearcher::setIndexFileName | ( | const std::string & | indexFileName_ | ) |
bool HCE::sphinx::SphinxSearcher::setIndexWeights | ( | std::vector< std::pair< std::string, int > > & | Vec | ) |
Definition at line 434 of file SphinxSearcher.cpp.
|
protected |
Definition at line 204 of file SphinxSearcher.cpp.
bool HCE::sphinx::SphinxSearcher::setMatchMode | ( | int | mode | ) |
|
protected |
Definition at line 718 of file SphinxSearcher.cpp.
|
protected |
Definition at line 195 of file SphinxSearcher.cpp.
bool HCE::sphinx::SphinxSearcher::setRankingMode | ( | int | ranker, |
const std::string & | rankexpr = "" |
||
) |
|
inline |
|
inline |
bool HCE::sphinx::SphinxSearcher::setSortMode | ( | int | mode, |
const std::string & | sortby = "" |
||
) |
|
inline |
|
protected |
Definition at line 397 of file SphinxSearcher.cpp.
bool HCE::sphinx::SphinxSearcher::startSearchd | ( | void | ) |
Definition at line 78 of file SphinxSearcher.cpp.
bool HCE::sphinx::SphinxSearcher::stopSearchd | ( | void | ) |
Definition at line 147 of file SphinxSearcher.cpp.
|
friend |
Definition at line 187 of file SphinxSearcher.hpp.
|
protected |
Definition at line 161 of file SphinxSearcher.hpp.
|
protected |
Definition at line 162 of file SphinxSearcher.hpp.
|
protected |
Definition at line 160 of file SphinxSearcher.hpp.
|
protected |
Definition at line 179 of file SphinxSearcher.hpp.
|
protected |
Definition at line 164 of file SphinxSearcher.hpp.
|
protected |
Definition at line 152 of file SphinxSearcher.hpp.
|
protected |
Definition at line 180 of file SphinxSearcher.hpp.
|
protected |
Definition at line 158 of file SphinxSearcher.hpp.
|
protected |
Definition at line 153 of file SphinxSearcher.hpp.
|
protected |
Definition at line 182 of file SphinxSearcher.hpp.
|
protected |
Definition at line 183 of file SphinxSearcher.hpp.
|
protected |
Definition at line 185 of file SphinxSearcher.hpp.
|
protected |
Definition at line 184 of file SphinxSearcher.hpp.
|
protected |
Definition at line 155 of file SphinxSearcher.hpp.
|
protected |
Definition at line 156 of file SphinxSearcher.hpp.
|
protected |
Definition at line 163 of file SphinxSearcher.hpp.