📄 classxapian_1_1queryparser.tex
字号:
\subsubsection[add\_\-boolean\_\-prefix]{\setlength{\rightskip}{0pt plus 5cm}void Xapian::Query\-Parser::add\_\-boolean\_\-prefix (const std::string \& {\em field}, const std::string \& {\em prefix})}}\label{classXapian_1_1QueryParser_5afd438f9901fbd5005a92161c61d1c8}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(\char`\"{}site\char`\"{}, \char`\"{}H\char`\"{});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).\begin{Desc}\item[Parameters:]\begin{description}\item[{\em field}]The user visible field name \item[{\em prefix}]The term prefix to map this to \end{description}\end{Desc}\hypertarget{classXapian_1_1QueryParser_d4829ddcaa0582ff94d1066870a18c97}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!add_prefix@{add\_\-prefix}}\index{add_prefix@{add\_\-prefix}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[add\_\-prefix]{\setlength{\rightskip}{0pt plus 5cm}void Xapian::Query\-Parser::add\_\-prefix (const std::string \& {\em field}, const std::string \& {\em prefix})}}\label{classXapian_1_1QueryParser_d4829ddcaa0582ff94d1066870a18c97}Add a probabilistic term prefix. E.g. qp.add\_\-prefix(\char`\"{}author\char`\"{}, \char`\"{}A\char`\"{});Allows the user to search for author:orwell which will search for the term \char`\"{}Aorwel\char`\"{} (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).\begin{Desc}\item[Parameters:]\begin{description}\item[{\em field}]The user visible field name \item[{\em prefix}]The term prefix to map this to \end{description}\end{Desc}\hypertarget{classXapian_1_1QueryParser_4a6323a8aea7734e447de1ba7eab31c1}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!get_default_op@{get\_\-default\_\-op}}\index{get_default_op@{get\_\-default\_\-op}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[get\_\-default\_\-op]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{Query::op} Xapian::Query\-Parser::get\_\-default\_\-op () const}}\label{classXapian_1_1QueryParser_4a6323a8aea7734e447de1ba7eab31c1}Get the default boolean operator. \hypertarget{classXapian_1_1QueryParser_89f9d15f38538a07497fdfc8658852b2}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!get_description@{get\_\-description}}\index{get_description@{get\_\-description}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[get\_\-description]{\setlength{\rightskip}{0pt plus 5cm}std::string Xapian::Query\-Parser::get\_\-description () const}}\label{classXapian_1_1QueryParser_89f9d15f38538a07497fdfc8658852b2}Return a string describing this object. \hypertarget{classXapian_1_1QueryParser_18adb637032c2149a0457f2f79f332a5}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!operator=@{operator=}}\index{operator=@{operator=}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[operator=]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classXapian_1_1QueryParser}{Query\-Parser}\& Xapian::Query\-Parser::operator= (const \hyperlink{classXapian_1_1QueryParser}{Query\-Parser} \& {\em o})}}\label{classXapian_1_1QueryParser_18adb637032c2149a0457f2f79f332a5}Assignment. \hypertarget{classXapian_1_1QueryParser_122985a5f84eca3271c1f40e982f9b09}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!parse_query@{parse\_\-query}}\index{parse_query@{parse\_\-query}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[parse\_\-query]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classXapian_1_1Query}{Query} Xapian::Query\-Parser::parse\_\-query (const std::string \& {\em query\_\-string}, unsigned {\em flags} = {\tt FLAG\_\-PHRASE$|$FLAG\_\-BOOLEAN$|$FLAG\_\-LOVEHATE})}}\label{classXapian_1_1QueryParser_122985a5f84eca3271c1f40e982f9b09}Parse a query. \begin{Desc}\item[Parameters:]\begin{description}\item[{\em query\_\-string}]A free-text query as entered by a user \item[{\em flags}]Zero or more Query::feature\_\-flag specifying what features the \hyperlink{classXapian_1_1QueryParser}{Query\-Parser} should support. Combine multiple values with bitwise-or ($|$). \end{description}\end{Desc}\hypertarget{classXapian_1_1QueryParser_576d221ba746506e51d9ea596ecb2cf6}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!set_database@{set\_\-database}}\index{set_database@{set\_\-database}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[set\_\-database]{\setlength{\rightskip}{0pt plus 5cm}void Xapian::Query\-Parser::set\_\-database (const \hyperlink{classXapian_1_1Database}{Database} \& {\em db})}}\label{classXapian_1_1QueryParser_576d221ba746506e51d9ea596ecb2cf6}Specify the database being searched. \hypertarget{classXapian_1_1QueryParser_2efe48be88c4872afec4bc963f417ea5}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!set_default_op@{set\_\-default\_\-op}}\index{set_default_op@{set\_\-default\_\-op}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[set\_\-default\_\-op]{\setlength{\rightskip}{0pt plus 5cm}void Xapian::Query\-Parser::set\_\-default\_\-op (\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{Query::op} {\em default\_\-op})}}\label{classXapian_1_1QueryParser_2efe48be88c4872afec4bc963f417ea5}Set the default boolean operator. \hypertarget{classXapian_1_1QueryParser_2312c9865a58cc1149fe7cda9f0c2585}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!set_stemmer@{set\_\-stemmer}}\index{set_stemmer@{set\_\-stemmer}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[set\_\-stemmer]{\setlength{\rightskip}{0pt plus 5cm}void Xapian::Query\-Parser::set\_\-stemmer (const \hyperlink{classXapian_1_1Stem}{Xapian::Stem} \& {\em stemmer})}}\label{classXapian_1_1QueryParser_2312c9865a58cc1149fe7cda9f0c2585}Set the stemmer. \hypertarget{classXapian_1_1QueryParser_c7dc3b55b6083bd3ff98fc8b2726c8fd}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!set_stemming_strategy@{set\_\-stemming\_\-strategy}}\index{set_stemming_strategy@{set\_\-stemming\_\-strategy}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[set\_\-stemming\_\-strategy]{\setlength{\rightskip}{0pt plus 5cm}void Xapian::Query\-Parser::set\_\-stemming\_\-strategy (stem\_\-strategy {\em strategy})}}\label{classXapian_1_1QueryParser_c7dc3b55b6083bd3ff98fc8b2726c8fd}Set the stemming strategy. \hypertarget{classXapian_1_1QueryParser_b1046610676f72ba564108f0df5d77ab}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!set_stopper@{set\_\-stopper}}\index{set_stopper@{set\_\-stopper}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[set\_\-stopper]{\setlength{\rightskip}{0pt plus 5cm}void Xapian::Query\-Parser::set\_\-stopper (const \hyperlink{classXapian_1_1Stopper}{Stopper} $\ast$ {\em stop} = {\tt NULL})}}\label{classXapian_1_1QueryParser_b1046610676f72ba564108f0df5d77ab}Set the stopper. \hypertarget{classXapian_1_1QueryParser_57ff03cd3fe1fa2b6e07fc347bee3590}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!stoplist_begin@{stoplist\_\-begin}}\index{stoplist_begin@{stoplist\_\-begin}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[stoplist\_\-begin]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classXapian_1_1TermIterator}{Term\-Iterator} Xapian::Query\-Parser::stoplist\_\-begin () const}}\label{classXapian_1_1QueryParser_57ff03cd3fe1fa2b6e07fc347bee3590}Iterate over terms omitted from the query as stopwords. \hypertarget{classXapian_1_1QueryParser_a2088e54f557e2d608247c5237a1bc3b}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!unstem_begin@{unstem\_\-begin}}\index{unstem_begin@{unstem\_\-begin}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[unstem\_\-begin]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classXapian_1_1TermIterator}{Term\-Iterator} Xapian::Query\-Parser::unstem\_\-begin (const std::string \& {\em term}) const}}\label{classXapian_1_1QueryParser_a2088e54f557e2d608247c5237a1bc3b}Iterate over unstemmed forms of the given (stemmed) term used in the query. \hypertarget{classXapian_1_1QueryParser_d30265b44cb3b0205aac306a042e5e0d}{\index{Xapian::QueryParser@{Xapian::Query\-Parser}!XAPIAN_DEPRECATED@{XAPIAN\_\-DEPRECATED}}\index{XAPIAN_DEPRECATED@{XAPIAN\_\-DEPRECATED}!Xapian::QueryParser@{Xapian::Query\-Parser}}\subsubsection[XAPIAN\_\-DEPRECATED]{\setlength{\rightskip}{0pt plus 5cm}Xapian::Query\-Parser::XAPIAN\_\-DEPRECATED (void {\em set\_\-stemming\_\-options}(const std::string \&lang, bool stem\_\-all=false, const Stopper $\ast$stop=NULL))}}\label{classXapian_1_1QueryParser_d30265b44cb3b0205aac306a042e5e0d}\begin{Desc}\item[\hyperlink{deprecated__deprecated000007}{Deprecated}]Deprecated method for backward compatibility.\end{Desc}Use set\_\-stemmer, set\_\-stemming\_\-strategy and/or set\_\-stopper instead.set\_\-stemming\_\-options(\char`\"{}\char`\"{}) -$>$ set\_\-stemming\_\-strategy(Xapian::Query\-Parser::STEM\_\-NONE)set\_\-stemming\_\-options(\char`\"{}none\char`\"{}) -$>$ set\_\-stemming\_\-strategy(Xapian::Query\-Parser::STEM\_\-NONE)set\_\-stemming\_\-options(LANG) -$>$ set\_\-stemmer(Xapian::Stem(LANG); set\_\-stemming\_\-strategy(Xapian::Query\-Parser::STEM\_\-SOME)set\_\-stemming\_\-options(LANG, false) -$>$ set\_\-stemmer(Xapian::Stem(LANG); set\_\-stemming\_\-strategy(Xapian::Query\-Parser::STEM\_\-SOME)set\_\-stemming\_\-options(LANG, true) -$>$ set\_\-stemmer(Xapian::Stem(LANG); set\_\-stemming\_\-strategy(Xapian::Query\-Parser::STEM\_\-ALL)If a third parameter is passed, set\_\-stopper(PARAM3) and treat the first two parameters as above. The documentation for this class was generated from the following file:\begin{CompactItemize}\item include/xapian/\hyperlink{queryparser_8h}{queryparser.h}\end{CompactItemize}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -