#include <queryparser.h>
Collaboration diagram for Xapian::QueryParser:
Public Types | |
enum | feature_flag { FLAG_BOOLEAN = 1, FLAG_PHRASE = 2, FLAG_LOVEHATE = 4, FLAG_BOOLEAN_ANY_CASE = 8, FLAG_WILDCARD = 16 } |
Enum of feature flags. More... | |
enum | stem_strategy { STEM_NONE, STEM_SOME, STEM_ALL } |
Public Member Functions | |
QueryParser (const QueryParser &o) | |
Copy constructor. | |
QueryParser & | operator= (const QueryParser &o) |
Assignment. | |
QueryParser () | |
Default constructor. | |
~QueryParser () | |
Destructor. | |
void | set_stemmer (const Xapian::Stem &stemmer) |
Set the stemmer. | |
void | set_stemming_strategy (stem_strategy strategy) |
Set the stemming strategy. | |
void | set_stopper (const Stopper *stop=NULL) |
Set the stopper. | |
XAPIAN_DEPRECATED (void set_stemming_options(const std::string &lang, bool stem_all=false, const Stopper *stop=NULL)) | |
void | set_default_op (Query::op default_op) |
Set the default boolean operator. | |
Query::op | get_default_op () const |
Get the default boolean operator. | |
void | set_database (const Database &db) |
Specify the database being searched. | |
Query | parse_query (const std::string &query_string, unsigned flags=FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE) |
Parse a query. | |
void | add_prefix (const std::string &field, const std::string &prefix) |
Add a probabilistic term prefix. | |
void | add_boolean_prefix (const std::string &field, const std::string &prefix) |
Add a boolean term prefix allowing the user to restrict a search with a boolean filter specified in the free text query. | |
TermIterator | stoplist_begin () const |
Iterate over terms omitted from the query as stopwords. | |
TermIterator | stoplist_end () const |
TermIterator | unstem_begin (const std::string &term) const |
Iterate over unstemmed forms of the given (stemmed) term used in the query. | |
TermIterator | unstem_end (const std::string &) const |
std::string | get_description () const |
Return a string describing this object. | |
Public Attributes | |
Xapian::Internal::RefCntPtr< Internal > | internal |
|
Enum of feature flags.
|
|
Copy constructor.
|
|
Default constructor.
|
|
Destructor.
|
|
Add a boolean term prefix allowing the user to restrict a search with a boolean filter specified in the free text query. E.g. qp.add_boolean_prefix("site", "H"); Allows the user to restrict a search with site:xapian.org which will be converted to Hxapian.org combined with any probabilistic query with OP_FILTER. Multiple fields can be mapped to the same prefix (so you can e.g. make site: and domain: aliases for each other).
|
|
Add a probabilistic term prefix. E.g. qp.add_prefix("author", "A"); Allows the user to search for author:orwell which will search for the term "Aorwel" (assuming English stemming is in use). Multiple fields can be mapped to the same prefix (so you can e.g. make title: and subject: aliases for each other).
|
|
Get the default boolean operator.
|
|
Return a string describing this object.
|
|
Assignment.
|
|
Parse a query.
|
|
Specify the database being searched.
|
|
Set the default boolean operator.
|
|
Set the stemmer.
|
|
Set the stemming strategy.
|
|
Set the stopper.
|
|
Iterate over terms omitted from the query as stopwords.
|
|
Iterate over unstemmed forms of the given (stemmed) term used in the query.
|
|
set_stemming_options("") -> set_stemming_strategy(Xapian::QueryParser::STEM_NONE) set_stemming_options("none") -> set_stemming_strategy(Xapian::QueryParser::STEM_NONE) set_stemming_options(LANG) -> set_stemmer(Xapian::Stem(LANG); set_stemming_strategy(Xapian::QueryParser::STEM_SOME) set_stemming_options(LANG, false) -> set_stemmer(Xapian::Stem(LANG); set_stemming_strategy(Xapian::QueryParser::STEM_SOME) set_stemming_options(LANG, true) -> set_stemmer(Xapian::Stem(LANG); set_stemming_strategy(Xapian::QueryParser::STEM_ALL) If a third parameter is passed, set_stopper(PARAM3) and treat the first two parameters as above. |