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=
"");
55 std::string
Process(
const std::string& json);
76 bool delField(
const std::string& name);
97 bool setSortMode(
int mode,
const std::string& sortby=
"");
133 bool addFilter(
const std::string& attrName,
long long value,
bool exclude=
false);
134 bool addFilter(
const std::string& attrName, std::vector<long long>& values,
bool exclude=
false);
135 bool addFilterRange(
const std::string& attrName,
long long umin,
long long umax,
bool exclude=
false);
136 bool addFilterFloatRange(
const std::string& attrName,
float fmin,
float fmax,
bool exclude=
false);
140 void setLimits(
unsigned int offset,
unsigned int limit,
unsigned int maxMatches,
unsigned int cutoff=0) throw (Poco::Exception);
142 void setMaxQueryTime(
unsigned long maxQueryTime) throw (Poco::Exception);
147 std::
string makeSearchCommand(const std::
string& json) throw (Poco::Exception, std::exception);
162 void cleanup(
char**& names,
int*& weights,
size_t& count);
163 bool setWeights(
char**& names,
int*& weights,
size_t& count, std::vector <std::pair<std::
string,
int> >& Vec);
164 void getWeights(
char**& names,
int*& weights,
size_t& count, std::vector <std::pair<std::
string,
int> >& Vec);
165 std::vector <std::pair<std::
string,
int> >::iterator
find(std::vector <std::pair<std::
string,
int> >& Vec, const std::
string& name);
190 #endif // SPHINX_SEARCHER_HPP