43 return "Xapian::Stopper subclass";
49 string desc(
"Xapian::SimpleStopper(");
50 set<string>::const_iterator i;
51 for (i = stop_words.begin(); i != stop_words.end(); ++i) {
52 if (i != stop_words.begin()) desc +=
' ';
92 internal->stem_action = strategy;
98 internal->stopper = stopper;
104 switch (default_op) {
116 "QueryParser::set_default_op() only accepts " 131 internal->default_op = default_op;
137 return internal->default_op;
151 internal->max_wildcard_expansion = max_expansion;
152 internal->max_wildcard_type = max_type;
155 internal->max_partial_expansion = max_expansion;
156 internal->max_partial_type = max_type;
162 const string &default_prefix)
165 internal->stoplist.clear();
166 internal->unstem.clear();
168 internal->errmsg = NULL;
170 if (query_string.empty())
return Query();
172 Query result =
internal->parse_query(query_string, flags, default_prefix);
175 result =
internal->parse_query(query_string, flags, default_prefix);
186 internal->add_prefix(field, prefix);
193 internal->add_prefix(field, proc);
201 internal->add_boolean_prefix(field, prefix, grouping);
210 internal->add_boolean_prefix(field, proc, grouping);
216 const list<string> & sl =
internal->stoplist;
223 struct range_adaptor :
public multimap<string, string>::iterator {
224 range_adaptor(multimap<string, string>::iterator i) :
225 multimap<string, string>::iterator(i) {}
226 const string &
operator*()
const {
return (*this)->second; }
228 auto range =
internal->unstem.equal_range(term);
230 range_adaptor(range.second)));
238 internal->rangeprocs.push_back(
RangeProc(range_proc, grouping));
244 return internal->corrected_query;
251 return "Xapian::QueryParser()";
The Xapian namespace contains public interfaces for the Xapian library.
void set_default_op(Query::op default_op)
Set the default operator.
This class is used to access a database, or a group of databases.
virtual ~ValueRangeProcessor()
Destructor.
Class representing a stemming algorithm.
void set_stopper(const Stopper *stop=NULL)
Set the stopper.
std::string get_corrected_query_string() const
Get the spelling-corrected query string.
TermIterator unstem_begin(const std::string &term) const
Begin iterator over unstemmed forms of the given stemmed query term.
Build a Xapian::Query object from a user query string.
Pick the maximum weight of any subquery.
Indicates a query string can't be parsed.
Produce a query which doesn't use positional information.
static Xapian::Stem stemmer
A vector-like container of terms which can be iterated.
void set_max_expansion(Xapian::termcount max_expansion, int max_type=Xapian::Query::WILDCARD_LIMIT_ERROR, unsigned flags=FLAG_WILDCARD|FLAG_PARTIAL)
Specify the maximum expansion of a wildcard and/or partial term.
The non-lemon-generated parts of the QueryParser class.
QueryParser()
Default constructor.
void add_rangeprocessor(Xapian::RangeProcessor *range_proc, const std::string *grouping=NULL)
Register a RangeProcessor.
void set_stemmer(const Xapian::Stem &stemmer)
Set the stemmer.
Hierarchy of classes which Xapian can throw as exceptions.
TermIterator stoplist_begin() const
Begin iterator over terms omitted from the query as stopwords.
Class for iterating over a list of terms.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
virtual ~FieldProcessor()
Destructor.
InvalidArgumentError indicates an invalid parameter value was passed to the API.
Base class for field processors.
Pick the best N subqueries and combine with OP_OR.
void set_stemming_strategy(stem_strategy strategy)
Set the stemming strategy.
Match only documents where all subqueries match near and in order.
~QueryParser()
Destructor.
stem_strategy
Stemming strategies, for use with set_stemming_strategy().
virtual ~RangeProcessor()
Destructor.
void add_boolean_prefix(const std::string &field, const std::string &prefix, const std::string *grouping=NULL)
Add a boolean term prefix allowing the user to restrict a search with a boolean filter specified in t...
Xapian::Internal::intrusive_ptr< Internal > internal
Query parse_query(const std::string &query_string, unsigned flags=FLAG_DEFAULT, const std::string &default_prefix=std::string())
Parse a query.
std::string get_description() const
Return a string describing this object.
Base class for range processors.
Match like OP_OR but weighting as if a single term.
This class stores a list of terms.
Match only documents which all subqueries match.
void set_database(const Database &db)
Specify the database being searched.
Accumulate unstem and stoplist results.
const Query operator*(double factor, const Query &q)
Scale a Xapian::Query object using OP_SCALE_WEIGHT.
virtual std::string get_description() const
Return a string describing this object.
QueryParser & operator=(const QueryParser &o)
Assignment.
Match only documents where all subqueries match near each other.
virtual std::string get_description() const
Return a string describing this object.
Match documents which at least one subquery matches.
Abstract base class for stop-word decision functor.
Various assertion macros.
Class representing a query.
void add_prefix(const std::string &field, const std::string &prefix)
Add a free-text field term prefix.
Class for iterating over a list of terms.
Generate n-grams for scripts without explicit word breaks.
Query::op get_default_op() const
Get the current default operator.
parsing a user query string to build a Xapian::Query object