hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
HCE::sphinx::SphinxSearcher Class Reference

#include <SphinxSearcher.hpp>

Inheritance diagram for HCE::sphinx::SphinxSearcher:
Collaboration diagram for HCE::sphinx::SphinxSearcher:

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

SphinxFunctionalObjectfObj
CustomMessagemessage
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)

Detailed Description

Definition at line 35 of file SphinxSearcher.hpp.

Constructor & Destructor Documentation

HCE::sphinx::SphinxSearcher::SphinxSearcher ( SphinxFunctionalObject fObj,
bool  startSearchd = false,
bool  stopSearchd_ = false 
)
explicit

Definition at line 26 of file SphinxSearcher.cpp.

HCE::sphinx::SphinxSearcher::~SphinxSearcher ( void  )
virtual

Definition at line 39 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Member Function Documentation

bool HCE::sphinx::SphinxSearcher::addField ( const std::string &  name,
int  weight = 0 
)

Definition at line 516 of file SphinxSearcher.cpp.

Here is the call graph for this function:

bool HCE::sphinx::SphinxSearcher::addFilter ( const std::string &  attrName,
long long  value,
bool  exclude = false 
)
protected

Definition at line 860 of file SphinxSearcher.cpp.

bool HCE::sphinx::SphinxSearcher::addFilter ( const std::string &  attrName,
std::vector< long long > &  values,
bool  exclude = false 
)
protected

Definition at line 865 of file SphinxSearcher.cpp.

bool HCE::sphinx::SphinxSearcher::addFilterFloatRange ( const std::string &  attrName,
float  fmin,
float  fmax,
bool  exclude = false 
)
protected

Definition at line 884 of file SphinxSearcher.cpp.

bool HCE::sphinx::SphinxSearcher::addFilterRange ( const std::string &  attrName,
long long  umin,
long long  umax,
bool  exclude = false 
)
protected

Definition at line 879 of file SphinxSearcher.cpp.

bool HCE::sphinx::SphinxSearcher::addIndexFile ( const std::string &  name,
int  weight = 0 
)

Definition at line 579 of file SphinxSearcher.cpp.

Here is the call graph for this function:

void HCE::sphinx::SphinxSearcher::applyFilter ( Poco::SharedPtr< SphinxFilter pFilter) throw (Poco::Exception)
protected

Definition at line 213 of file SphinxSearcher.cpp.

void HCE::sphinx::SphinxSearcher::cleanup ( char **&  names,
int *&  weights,
size_t &  count 
)
protected

Definition at line 377 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::close ( void  )

Definition at line 353 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::delField ( const std::string &  name)

Definition at line 558 of file SphinxSearcher.cpp.

Here is the call graph for this function:

bool HCE::sphinx::SphinxSearcher::delIndexFile ( const std::string &  name)

Definition at line 621 of file SphinxSearcher.cpp.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::pair< std::string, int > >::iterator HCE::sphinx::SphinxSearcher::find ( std::vector< std::pair< std::string, int > > &  Vec,
const std::string &  name 
)
staticprotected

Definition at line 470 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

std::set<std::string>& HCE::sphinx::SphinxSearcher::getAlloedFields ( void  )
inlineprotected

Definition at line 172 of file SphinxSearcher.hpp.

unsigned long HCE::sphinx::SphinxSearcher::getDefaultRequestTimeout ( void  ) const
inline

Definition at line 132 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

size_t HCE::sphinx::SphinxSearcher::getFieldsCount ( void  ) const
inline

Definition at line 121 of file SphinxSearcher.hpp.

int HCE::sphinx::SphinxSearcher::getFieldWeight ( const std::string &  name)

Definition at line 498 of file SphinxSearcher.cpp.

Here is the call graph for this function:

void HCE::sphinx::SphinxSearcher::getFieldWeights ( std::vector< std::pair< std::string, int > > &  Vec)

Definition at line 460 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::set<std::string>& HCE::sphinx::SphinxSearcher::getFullSchemaNames ( void  )
inlineprotected

Definition at line 176 of file SphinxSearcher.hpp.

size_t HCE::sphinx::SphinxSearcher::getIndexesCount ( void  ) const
inline

Definition at line 122 of file SphinxSearcher.hpp.

std::string HCE::sphinx::SphinxSearcher::getIndexFileName ( void  ) const
inline

Definition at line 125 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

int HCE::sphinx::SphinxSearcher::getIndexWeight ( const std::string &  name)

Definition at line 507 of file SphinxSearcher.cpp.

Here is the call graph for this function:

void HCE::sphinx::SphinxSearcher::getIndexWeights ( std::vector< std::pair< std::string, int > > &  Vec)

Definition at line 465 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string HCE::sphinx::SphinxSearcher::getServerHost ( void  ) const
inline

Definition at line 64 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

int HCE::sphinx::SphinxSearcher::getServerPort ( void  ) const
inline

Definition at line 67 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

unsigned long long HCE::sphinx::SphinxSearcher::getTimeoutedRequests ( void  ) const
inline

Definition at line 128 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

void HCE::sphinx::SphinxSearcher::getWeights ( char **&  names,
int *&  weights,
size_t &  count,
std::vector< std::pair< std::string, int > > &  Vec 
)
protected

Definition at line 450 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::isActiveSearchd ( void  )

Definition at line 178 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::isAllowedFields ( const std::string &  extendedFieldName)
protected

Definition at line 61 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::isConnected ( void  ) const
inline

Definition at line 54 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::isExistField ( const std::string &  name)

Definition at line 482 of file SphinxSearcher.cpp.

Here is the call graph for this function:

bool HCE::sphinx::SphinxSearcher::isExistIndexFile ( const std::string &  name)

Definition at line 490 of file SphinxSearcher.cpp.

Here is the call graph for this function:

bool HCE::sphinx::SphinxSearcher::isExistSchemaNames ( const std::string &  schemaName)
protected

Definition at line 73 of file SphinxSearcher.cpp.

bool HCE::sphinx::SphinxSearcher::isNeedStopSearchd ( void  ) const
inline

Definition at line 53 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::isStoppedSearchd ( void  ) const
inline

Definition at line 55 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

std::string HCE::sphinx::SphinxSearcher::makeSearchCommand ( const std::string &  json) throw (Poco::Exception, std::exception)
protected

Definition at line 946 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::open ( void  )

Definition at line 322 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string HCE::sphinx::SphinxSearcher::Process ( const std::string &  json)
virtual

Implements HCE::sphinx::SphinxSearchInterface.

Definition at line 894 of file SphinxSearcher.cpp.

Here is the call graph for this function:

SphinxOutputJsonMessage HCE::sphinx::SphinxSearcher::Process ( SphinxInputJsonMessage inputJsonMessage)
virtual

Implements HCE::sphinx::SphinxSearchInterface.

Definition at line 1080 of file SphinxSearcher.cpp.

Here is the call graph for this function:

void HCE::sphinx::SphinxSearcher::resetFilters ( void  )
protected

Definition at line 889 of file SphinxSearcher.cpp.

void HCE::sphinx::SphinxSearcher::resetTimeoutedRequests ( void  )
inline

Definition at line 129 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

void HCE::sphinx::SphinxSearcher::resizeResultData ( size_t  matchesCount,
size_t  attributesCount 
)

Definition at line 49 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::searchDocument ( const std::string &  query,
SphinxResultDataMemoryManager resultMemoryManager,
SphinxRequestInfo requestInfo 
)

Definition at line 749 of file SphinxSearcher.cpp.

Here is the call graph for this function:

void HCE::sphinx::SphinxSearcher::setAllowedFields ( std::vector< std::string > &  queryExtendedFields)
protected

Definition at line 54 of file SphinxSearcher.cpp.

void HCE::sphinx::SphinxSearcher::setDefaultRequestTimeout ( unsigned long  defaultRequestTimeout_)
inline

Definition at line 131 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::setField ( const std::string &  name,
int  weight 
)

Definition at line 537 of file SphinxSearcher.cpp.

Here is the call graph for this function:

bool HCE::sphinx::SphinxSearcher::setFieldWeights ( std::vector< std::pair< std::string, int > > &  Vec)

Definition at line 421 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::sphinx::SphinxSearcher::setFullSchemaNames ( std::vector< std::string > &  schemaNames)
protected

Definition at line 66 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::setIndexFile ( const std::string &  name,
int  weight 
)

Definition at line 600 of file SphinxSearcher.cpp.

Here is the call graph for this function:

bool HCE::sphinx::SphinxSearcher::setIndexFileName ( const std::string &  indexFileName_)

Definition at line 727 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::setIndexWeights ( std::vector< std::pair< std::string, int > > &  Vec)

Definition at line 434 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void HCE::sphinx::SphinxSearcher::setLimits ( unsigned int  offset,
unsigned int  limit,
unsigned int  maxMatches,
unsigned int  cutoff = 0 
) throw (Poco::Exception)
protected

Definition at line 204 of file SphinxSearcher.cpp.

bool HCE::sphinx::SphinxSearcher::setMatchMode ( int  mode)

Definition at line 641 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

void HCE::sphinx::SphinxSearcher::setMaxQueryTime ( unsigned long  maxQueryTime) throw (Poco::Exception)
protected

Definition at line 718 of file SphinxSearcher.cpp.

void HCE::sphinx::SphinxSearcher::setMaxResultsNumber ( unsigned int  maxResultsNumber) throw (Poco::Exception)
protected

Definition at line 195 of file SphinxSearcher.cpp.

bool HCE::sphinx::SphinxSearcher::setRankingMode ( int  ranker,
const std::string &  rankexpr = "" 
)

Definition at line 690 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

void HCE::sphinx::SphinxSearcher::setServerHost ( const std::string &  serverHost_)
inline

Definition at line 63 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

void HCE::sphinx::SphinxSearcher::setServerPort ( int  serverPort_)
inline

Definition at line 66 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::setSortMode ( int  mode,
const std::string &  sortby = "" 
)

Definition at line 662 of file SphinxSearcher.cpp.

Here is the caller graph for this function:

void HCE::sphinx::SphinxSearcher::setTimeoutedRequests ( unsigned long long  timeoutedRequests_)
inline

Definition at line 127 of file SphinxSearcher.hpp.

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::setWeights ( char **&  names,
int *&  weights,
size_t &  count,
std::vector< std::pair< std::string, int > > &  Vec 
)
protected

Definition at line 397 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::startSearchd ( void  )

Definition at line 78 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool HCE::sphinx::SphinxSearcher::stopSearchd ( void  )

Definition at line 147 of file SphinxSearcher.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class SphinxFunctionalObject
friend

Definition at line 187 of file SphinxSearcher.hpp.

Member Data Documentation

bool HCE::sphinx::SphinxSearcher::_isConnected
protected

Definition at line 161 of file SphinxSearcher.hpp.

bool HCE::sphinx::SphinxSearcher::_isStoppedSearchd
protected

Definition at line 162 of file SphinxSearcher.hpp.

bool HCE::sphinx::SphinxSearcher::_StopSearchd
protected

Definition at line 160 of file SphinxSearcher.hpp.

std::set<std::string> HCE::sphinx::SphinxSearcher::allowedFields
protected

Definition at line 179 of file SphinxSearcher.hpp.

unsigned long HCE::sphinx::SphinxSearcher::defaultRequestTimeout
protected

Definition at line 164 of file SphinxSearcher.hpp.

SphinxFunctionalObject& HCE::sphinx::SphinxSearcher::fObj
protected

Definition at line 152 of file SphinxSearcher.hpp.

std::set<std::string> HCE::sphinx::SphinxSearcher::fullSchemaNames
protected

Definition at line 180 of file SphinxSearcher.hpp.

std::string HCE::sphinx::SphinxSearcher::indexFileName
protected

Definition at line 158 of file SphinxSearcher.hpp.

CustomMessage& HCE::sphinx::SphinxSearcher::message
protected

Definition at line 153 of file SphinxSearcher.hpp.

SphinxRequestInfo HCE::sphinx::SphinxSearcher::requestInfo
protected

Definition at line 182 of file SphinxSearcher.hpp.

SphinxResultData HCE::sphinx::SphinxSearcher::resultData
protected

Definition at line 183 of file SphinxSearcher.hpp.

SphinxResultDataMemoryManager HCE::sphinx::SphinxSearcher::resultMemoryManager
protected

Definition at line 185 of file SphinxSearcher.hpp.

SphinxResultDataSerializator HCE::sphinx::SphinxSearcher::resultSerializator
protected

Definition at line 184 of file SphinxSearcher.hpp.

std::string HCE::sphinx::SphinxSearcher::serverHost
protected

Definition at line 155 of file SphinxSearcher.hpp.

int HCE::sphinx::SphinxSearcher::serverPort
protected

Definition at line 156 of file SphinxSearcher.hpp.

unsigned long long HCE::sphinx::SphinxSearcher::timeoutedRequests
protected

Definition at line 163 of file SphinxSearcher.hpp.


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