14 #ifndef SPHINX_SEARCHER_HPP
15 #define SPHINX_SEARCHER_HPP
19 #include "sphinxclient.h"
33 class SphinxFunctionalObject;
49 bool easyStart(
int matchMode=SPH_MATCH_EXTENDED2,
int sortMode=SPH_SORT_RELEVANCE,
int rankingMode=SPH_RANK_DEFAULT,
const std::string& rankexpr=
"");
57 std::string
Process(
const std::string& json);
99 bool setSortMode(
int mode,
const std::string& sortby=
"");
136 bool addFilter(
const std::string& attrName,
long long value,
bool exclude=
false);
137 bool addFilter(
const std::string& attrName, std::vector<long long>& values,
bool exclude=
false);
138 bool addFilterRange(
const std::string& attrName,
long long umin,
long long umax,
bool exclude=
false);
139 bool addFilterFloatRange(
const std::string& attrName,
float fmin,
float fmax,
bool exclude=
false);
143 void setLimits(
unsigned int offset,
unsigned int limit,
unsigned int maxMatches,
unsigned int cutoff=0) throw (Poco::Exception);
145 void setMaxQueryTime(
unsigned long maxQueryTime) throw (Poco::Exception);
150 std::
string makeSearchCommand(const std::
string& json) throw (Poco::Exception, std::exception);
166 void cleanup(
char**& names,
int*& weights,
size_t& count);
167 bool setWeights(
char**& names,
int*& weights,
size_t& count, std::vector <std::pair<std::
string,
int> >& Vec);
168 void getWeights(
char**& names,
int*& weights,
size_t& count, std::vector <std::pair<std::
string,
int> >& Vec);
169 static std::vector <std::pair<std::
string,
int> >::iterator
find(std::vector <std::pair<std::
string,
int> >& Vec, const std::
string&
name);
194 #endif // SPHINX_SEARCHER_HPP