📄 classxapian_1_1query.tex
字号:
\hypertarget{classXapian_1_1Query}{\section{Xapian::Query Class Reference}\label{classXapian_1_1Query}\index{Xapian::Query@{Xapian::Query}}}Class representing a query. {\tt \#include $<$query.h$>$}Collaboration diagram for Xapian::Query:\begin{figure}[H]\begin{center}\leavevmode\includegraphics[width=119pt]{classXapian_1_1Query__coll__graph}\end{center}\end{figure}\subsection*{Public Types}\begin{CompactItemize}\item enum \hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{op} \{ \par\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bb99aad2dfc85eccc56163bc65eb0fdda}{OP\_\-AND}, \hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bc50e54f3dd9dc59dab7daa2c50cf631b}{OP\_\-OR}, \hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bda56688a72af48cc1cee70a5b36f2a94}{OP\_\-AND\_\-NOT}, \hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b3f186e28a8cc2a5c4cb99745dda5cedf}{OP\_\-XOR}, \par\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b5990dfefc0a0a63861630b743f507356}{OP\_\-AND\_\-MAYBE}, \hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bc657f344bf26128ab7bf8fe25410b102}{OP\_\-FILTER}, \hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b7a78c8353d5d06d3a38c1899ae762b21}{OP\_\-NEAR}, \hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bce19bf1e7b2d8aa393aabdd061a0866e}{OP\_\-PHRASE}, \par\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b9a010fd66a56d9242d6dfae2bae0850b}{OP\_\-ELITE\_\-SET} = 10 \}\begin{CompactList}\small\item\em Enum of possible query operations. \item\end{CompactList}\end{CompactItemize}\subsection*{Public Member Functions}\begin{CompactItemize}\item \hyperlink{classXapian_1_1Query_a95690337034e432c8e5e82bdfff80ea}{Query} (const \hyperlink{classXapian_1_1Query}{Query} \©me)\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item \hyperlink{classXapian_1_1Query}{Query} \& \hyperlink{classXapian_1_1Query_edfe00f53f010c76c290a0a14873c7a9}{operator=} (const \hyperlink{classXapian_1_1Query}{Query} \©me)\begin{CompactList}\small\item\em Assignment. \item\end{CompactList}\item \hyperlink{classXapian_1_1Query_836b588120b705758f2e25b67c781b4c}{Query} ()\begin{CompactList}\small\item\em Default constructor: makes an empty query which matches no documents. \item\end{CompactList}\item \hyperlink{classXapian_1_1Query_420644d38cde25cef056d18ce7fe1c31}{$\sim$Query} ()\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item \hyperlink{classXapian_1_1Query_f396e213df0d8bcffa473a75ebf228d6}{Query} (const std::string \&tname\_\-, \hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} wqf\_\-=1, \hyperlink{types_8h_5cdae0172ef811a7c08017eb4429c311}{Xapian::termpos} pos\_\-=0)\begin{CompactList}\small\item\em A query consisting of a single term. \item\end{CompactList}\item \hyperlink{classXapian_1_1Query_cd51f1304501311c8dde31dc54c36048}{Query} (\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{Query::op} op\_\-, const \hyperlink{classXapian_1_1Query}{Query} \&left, const \hyperlink{classXapian_1_1Query}{Query} \&right)\begin{CompactList}\small\item\em A query consisting of two subqueries, opp-ed together. \item\end{CompactList}\item \hyperlink{classXapian_1_1Query_1e5e506b8659c9c1be88837dcf643163}{Query} (\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{Query::op} op\_\-, const std::string \&left, const std::string \&right)\begin{CompactList}\small\item\em A query consisting of two termnames opp-ed together. \item\end{CompactList}\item template$<$class Iterator$>$ \hyperlink{classXapian_1_1Query_a2edfc5e6ae285afb9fde26d096c5ed8}{Query} (\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{Query::op} op\_\-, Iterator qbegin, Iterator qend, \hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} parameter=0)\begin{CompactList}\small\item\em Combine a number of \hyperlink{classXapian_1_1Query}{Xapian::Query}-s with the specified operator. \item\end{CompactList}\item \hyperlink{classXapian_1_1Query_fc55f358e3f245ecc6be8f5652be0292}{Query} (\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{Query::op} op\_\-, \hyperlink{classXapian_1_1Query}{Xapian::Query} q)\begin{CompactList}\small\item\em Apply the specified operator to a single \hyperlink{classXapian_1_1Query}{Xapian::Query} object. \item\end{CompactList}\item \hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} \hyperlink{classXapian_1_1Query_de144c7f420490da9b48373e80e2c604}{get\_\-length} () const \begin{CompactList}\small\item\em Get the length of the query, used by some ranking formulae. \item\end{CompactList}\item \hyperlink{classXapian_1_1TermIterator}{Term\-Iterator} \hyperlink{classXapian_1_1Query_e290b52f21e5652067b202b78f8c03db}{get\_\-terms\_\-begin} () const \begin{CompactList}\small\item\em Return a \hyperlink{classXapian_1_1TermIterator}{Xapian::Term\-Iterator} returning all the terms in the query, in order of termpos. \item\end{CompactList}\item \hyperlink{classXapian_1_1TermIterator}{Term\-Iterator} \hyperlink{classXapian_1_1Query_c31fa68e27c1dcd54a4bd7b637fec062}{get\_\-terms\_\-end} () const \begin{CompactList}\small\item\em Return a \hyperlink{classXapian_1_1TermIterator}{Xapian::Term\-Iterator} to the end of the list of terms in the query. \item\end{CompactList}\item bool \hyperlink{classXapian_1_1Query_7c8bd61280be052e5fabc552d2b20f8c}{empty} () const \begin{CompactList}\small\item\em Test is the query is empty (i.e. \item\end{CompactList}\item \hyperlink{classXapian_1_1Query_b8151ba78abb59a3203f9852c0f1d033}{XAPIAN\_\-DEPRECATED} (bool is\_\-empty() const)\item std::string \hyperlink{classXapian_1_1Query_c9d1e428cdddcf5250f10b814eb4bb30}{get\_\-description} () const \begin{CompactList}\small\item\em Returns a string representing the query. \item\end{CompactList}\item \hypertarget{classXapian_1_1Query_f53f683597dfb48fefe65aecf7a9c32f}{template$<$class Iterator$>$ {\bf Query} (\hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{Query::op} op\_\-, Iterator qbegin, Iterator qend, \hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{termcount} parameter)}\label{classXapian_1_1Query_f53f683597dfb48fefe65aecf7a9c32f}\end{CompactItemize}\subsection*{Public Attributes}\begin{CompactItemize}\item \hypertarget{classXapian_1_1Query_96ba13c8c15d7f8d8275cc8558eaa622}{\hyperlink{classXapian_1_1Internal_1_1RefCntPtr}{Xapian::Internal::Ref\-Cnt\-Ptr}$<$ \hyperlink{classXapian_1_1Query_1_1Internal}{Internal} $>$ {\bf internal}}\label{classXapian_1_1Query_96ba13c8c15d7f8d8275cc8558eaa622}\end{CompactItemize}\subsection*{Classes}\begin{CompactItemize}\item class \hyperlink{classXapian_1_1Query_1_1Internal}{Internal}\begin{CompactList}\small\item\em \hyperlink{classXapian_1_1Query_1_1Internal}{Internal} class, implementing most of \hyperlink{classXapian_1_1Query}{Xapian::Query}. \item\end{CompactList}\end{CompactItemize}\subsection{Detailed Description}Class representing a query. Queries are represented as a tree of objects. \subsection{Member Enumeration Documentation}\hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{\index{Xapian::Query@{Xapian::Query}!op@{op}}\index{op@{op}!Xapian::Query@{Xapian::Query}}\subsubsection[op]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}{Xapian::Query::op}}}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b}Enum of possible query operations. \begin{Desc}\item[Enumerator: ]\par\begin{description}\index{OP_AND@{OP\_\-AND}!Xapian::Query@{Xapian::Query}}\index{Xapian::Query@{Xapian::Query}!OP_AND@{OP\_\-AND}}\item[{\em \hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bb99aad2dfc85eccc56163bc65eb0fdda}{OP\_\-AND}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bb99aad2dfc85eccc56163bc65eb0fdda}}]Return iff both subqueries are satisfied. \index{OP_OR@{OP\_\-OR}!Xapian::Query@{Xapian::Query}}\index{Xapian::Query@{Xapian::Query}!OP_OR@{OP\_\-OR}}\item[{\em \hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bc50e54f3dd9dc59dab7daa2c50cf631b}{OP\_\-OR}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bc50e54f3dd9dc59dab7daa2c50cf631b}}]Return if either subquery is satisfied. \index{OP_AND_NOT@{OP\_\-AND\_\-NOT}!Xapian::Query@{Xapian::Query}}\index{Xapian::Query@{Xapian::Query}!OP_AND_NOT@{OP\_\-AND\_\-NOT}}\item[{\em \hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bda56688a72af48cc1cee70a5b36f2a94}{OP\_\-AND\_\-NOT}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bda56688a72af48cc1cee70a5b36f2a94}}]Return if left but not right satisfied. \index{OP_XOR@{OP\_\-XOR}!Xapian::Query@{Xapian::Query}}\index{Xapian::Query@{Xapian::Query}!OP_XOR@{OP\_\-XOR}}\item[{\em \hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b3f186e28a8cc2a5c4cb99745dda5cedf}{OP\_\-XOR}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b3f186e28a8cc2a5c4cb99745dda5cedf}}]Return if one query satisfied, but not both. \index{OP_AND_MAYBE@{OP\_\-AND\_\-MAYBE}!Xapian::Query@{Xapian::Query}}\index{Xapian::Query@{Xapian::Query}!OP_AND_MAYBE@{OP\_\-AND\_\-MAYBE}}\item[{\em \hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b5990dfefc0a0a63861630b743f507356}{OP\_\-AND\_\-MAYBE}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b5990dfefc0a0a63861630b743f507356}}]Return iff left satisfied, but use weights from both. \index{OP_FILTER@{OP\_\-FILTER}!Xapian::Query@{Xapian::Query}}\index{Xapian::Query@{Xapian::Query}!OP_FILTER@{OP\_\-FILTER}}\item[{\em \hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bc657f344bf26128ab7bf8fe25410b102}{OP\_\-FILTER}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bc657f344bf26128ab7bf8fe25410b102}}]As AND, but use only weights from left subquery. \index{OP_NEAR@{OP\_\-NEAR}!Xapian::Query@{Xapian::Query}}\index{Xapian::Query@{Xapian::Query}!OP_NEAR@{OP\_\-NEAR}}\item[{\em \hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b7a78c8353d5d06d3a38c1899ae762b21}{OP\_\-NEAR}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b7a78c8353d5d06d3a38c1899ae762b21}}]Find occurrences of a list of terms with all the terms occurring within a specified window of positions. Each occurrence of a term must be at a different position, but the order they appear in is irrelevant.The window parameter should be specified for this operation, but will default to the number of terms in the list. \index{OP_PHRASE@{OP\_\-PHRASE}!Xapian::Query@{Xapian::Query}}\index{Xapian::Query@{Xapian::Query}!OP_PHRASE@{OP\_\-PHRASE}}\item[{\em \hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bce19bf1e7b2d8aa393aabdd061a0866e}{OP\_\-PHRASE}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100bce19bf1e7b2d8aa393aabdd061a0866e}}]Find occurrences of a list of terms with all the terms occurring within a specified window of positions, and all the terms appearing in the order specified. Each occurrence of a term must be at a different position.The window parameter should be specified for this operation, but will default to the number of terms in the list. \index{OP_ELITE_SET@{OP\_\-ELITE\_\-SET}!Xapian::Query@{Xapian::Query}}\index{Xapian::Query@{Xapian::Query}!OP_ELITE_SET@{OP\_\-ELITE\_\-SET}}\item[{\em \hypertarget{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b9a010fd66a56d9242d6dfae2bae0850b}{OP\_\-ELITE\_\-SET}\label{classXapian_1_1Query_7e7b6b8ad0c915c2364578dfaaf6100b9a010fd66a56d9242d6dfae2bae0850b}}]Select an elite set from the subqueries, and perform a query with these combined as an OR query. \end{description}\end{Desc}\subsection{Constructor \& Destructor Documentation}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -