📄 classxapian_1_1enquire.tex
字号:
\hypertarget{classXapian_1_1Enquire}{\section{Xapian::Enquire Class Reference}\label{classXapian_1_1Enquire}\index{Xapian::Enquire@{Xapian::Enquire}}}This class provides an interface to the information retrieval system for the purpose of searching. {\tt \#include $<$enquire.h$>$}Collaboration diagram for Xapian::Enquire:\begin{figure}[H]\begin{center}\leavevmode\includegraphics[width=119pt]{classXapian_1_1Enquire__coll__graph}\end{center}\end{figure}\subsection*{Public Types}\begin{CompactItemize}\item enum {\bf docid\_\-order} \{ {\bf ASCENDING} = 1, {\bf DESCENDING} = 0, {\bf DONT\_\-CARE} = 2 \}\end{CompactItemize}\subsection*{Public Member Functions}\begin{CompactItemize}\item \hyperlink{classXapian_1_1Enquire_7571e81ebfd755f5f84c674684229431}{Enquire} (const \hyperlink{classXapian_1_1Database}{Database} \&databases, \hyperlink{classXapian_1_1ErrorHandler}{Error\-Handler} $\ast$errorhandler\_\-=0)\begin{CompactList}\small\item\em Create a \hyperlink{classXapian_1_1Enquire}{Xapian::Enquire} object. \item\end{CompactList}\item \hyperlink{classXapian_1_1Enquire_808479faae76453f34a24881805e75b9}{$\sim$Enquire} ()\begin{CompactList}\small\item\em Close the \hyperlink{classXapian_1_1Enquire}{Xapian::Enquire} object. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_1148d960120662e5543e2a2b12620318}{set\_\-query} (const \hyperlink{classXapian_1_1Query}{Xapian::Query} \&query, \hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} qlen=0)\begin{CompactList}\small\item\em Set the query to run. \item\end{CompactList}\item const \hyperlink{classXapian_1_1Query}{Xapian::Query} \& \hyperlink{classXapian_1_1Enquire_a526b0e563e20ea18a06d4033529208c}{get\_\-query} ()\begin{CompactList}\small\item\em Get the query which has been set. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_d5c72e6f34c5c2da5f0b8c79736704ab}{set\_\-weighting\_\-scheme} (const \hyperlink{classXapian_1_1Weight}{Weight} \&weight\_\-)\begin{CompactList}\small\item\em Set the weighting scheme to use for queries. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_b5ef9cc615f7dd8414175c7529ee4e0c}{set\_\-collapse\_\-key} (\hyperlink{types_8h_f24564a367ebbc8f80cf9a1dbd1e81fd}{Xapian::valueno} collapse\_\-key)\begin{CompactList}\small\item\em Set the collapse key to use for queries. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_bbf7ff734ff6adcb301e493f6eed803b}{set\_\-docid\_\-order} (docid\_\-order order)\begin{CompactList}\small\item\em Set the direction in which documents are ordered by document id in the returned \hyperlink{classXapian_1_1MSet}{MSet}. \item\end{CompactList}\item \hyperlink{classXapian_1_1Enquire_ebcd04916dbfa6af02a2b1354ebfc701}{XAPIAN\_\-DEPRECATED} (void set\_\-sort\_\-forward(bool sort\_\-forward))\begin{CompactList}\small\item\em For compatibility with \hyperlink{namespaceXapian}{Xapian} 0.8.5 and earlier. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_dadaa8401e40ab4cec090bc1541a11b7}{set\_\-cutoff} (\hyperlink{types_8h_d9213278aaed43f1ab0110c87a6b7476}{Xapian::percent} percent\_\-cutoff, \hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} weight\_\-cutoff=0)\begin{CompactList}\small\item\em Set the percentage and/or weight cutoffs. \item\end{CompactList}\item \hyperlink{classXapian_1_1Enquire_d6b752a7d15eb88d58dd8c90cafd4250}{XAPIAN\_\-DEPRECATED} (void set\_\-sorting(\hyperlink{types_8h_f24564a367ebbc8f80cf9a1dbd1e81fd}{Xapian::valueno} sort\_\-key, int sort\_\-bands, bool sort\_\-by\_\-relevance=false))\begin{CompactList}\small\item\em For compatibility with \hyperlink{namespaceXapian}{Xapian} 0.8.5 and earlier. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_80a33a28791c05167204706c1a9d986b}{set\_\-sort\_\-by\_\-relevance} ()\begin{CompactList}\small\item\em Set the sorting to be by relevance only. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_cc00543ba0459cc8ceca25e89fe69e19}{set\_\-sort\_\-by\_\-value} (\hyperlink{types_8h_f24564a367ebbc8f80cf9a1dbd1e81fd}{Xapian::valueno} sort\_\-key, bool ascending=true)\begin{CompactList}\small\item\em Set the sorting to be by value only. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_9d30933e61e605d2745af701ae9d829d}{set\_\-sort\_\-by\_\-value\_\-then\_\-relevance} (\hyperlink{types_8h_f24564a367ebbc8f80cf9a1dbd1e81fd}{Xapian::valueno} sort\_\-key, bool ascending=true)\begin{CompactList}\small\item\em Set the sorting to be by value, then by relevance for documents with the same value. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_f24f34e6671c42f5120431f6a81f8404}{set\_\-sort\_\-by\_\-relevance\_\-then\_\-value} (\hyperlink{types_8h_f24564a367ebbc8f80cf9a1dbd1e81fd}{Xapian::valueno} sort\_\-key, bool ascending=true)\begin{CompactList}\small\item\em Set the sorting to be by relevance then value. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_271e074ce109e77e5486f51cb0c4e2d4}{set\_\-bias} (\hyperlink{types_8h_167860ee249b702eb746dca0d245f808}{Xapian::weight} bias\_\-weight, time\_\-t bias\_\-halflife)\begin{CompactList}\small\item\em Set the bias functor parameters. \item\end{CompactList}\item \hyperlink{classXapian_1_1MSet}{MSet} \hyperlink{classXapian_1_1Enquire_edb5fb761acc0bb2249bec375883a093}{get\_\-mset} (\hyperlink{types_8h_b4166dca4ac15d88c933bbb8e0d55d23}{Xapian::doccount} first, \hyperlink{types_8h_b4166dca4ac15d88c933bbb8e0d55d23}{Xapian::doccount} maxitems, \hyperlink{types_8h_b4166dca4ac15d88c933bbb8e0d55d23}{Xapian::doccount} checkatleast=0, const \hyperlink{classXapian_1_1RSet}{RSet} $\ast$omrset=0, const \hyperlink{classXapian_1_1MatchDecider}{Match\-Decider} $\ast$mdecider=0) const \begin{CompactList}\small\item\em Get (a portion of) the match set for the current query. \item\end{CompactList}\item \hypertarget{classXapian_1_1Enquire_d53aba9cb5b62d14dce5395f568c050f}{\hyperlink{classXapian_1_1MSet}{MSet} {\bf get\_\-mset} (\hyperlink{types_8h_b4166dca4ac15d88c933bbb8e0d55d23}{Xapian::doccount} first, \hyperlink{types_8h_b4166dca4ac15d88c933bbb8e0d55d23}{Xapian::doccount} maxitems, const \hyperlink{classXapian_1_1RSet}{RSet} $\ast$omrset, const \hyperlink{classXapian_1_1MatchDecider}{Match\-Decider} $\ast$mdecider=0) const }\label{classXapian_1_1Enquire_d53aba9cb5b62d14dce5395f568c050f}\item \hyperlink{classXapian_1_1ESet}{ESet} \hyperlink{classXapian_1_1Enquire_c04aa26eff82db9fd810b8125a31ee55}{get\_\-eset} (\hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} maxitems, const \hyperlink{classXapian_1_1RSet}{RSet} \&omrset, int flags=0, double k=1.0, const \hyperlink{classXapian_1_1ExpandDecider}{Xapian::Expand\-Decider} $\ast$edecider=0) const \begin{CompactList}\small\item\em Get the expand set for the given rset. \item\end{CompactList}\item \hyperlink{classXapian_1_1ESet}{ESet} \hyperlink{classXapian_1_1Enquire_f73e3672a3f1077309fbc99ef2db5412}{get\_\-eset} (\hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} maxitems, const \hyperlink{classXapian_1_1RSet}{RSet} \&omrset, const \hyperlink{classXapian_1_1ExpandDecider}{Xapian::Expand\-Decider} $\ast$edecider) const \begin{CompactList}\small\item\em Get the expand set for the given rset. \item\end{CompactList}\item \hyperlink{classXapian_1_1TermIterator}{Term\-Iterator} \hyperlink{classXapian_1_1Enquire_dda4181ccd15beb52c39f5e24adbb25b}{get\_\-matching\_\-terms\_\-begin} (\hyperlink{types_8h_53073891e45d892a8d8a5d8f87f41402}{Xapian::docid} did) const \begin{CompactList}\small\item\em Get terms which match a given document, by document id. \item\end{CompactList}\item \hyperlink{classXapian_1_1TermIterator}{Term\-Iterator} \hyperlink{classXapian_1_1Enquire_6a27b926405ef71ab138fa656dab0bd4}{get\_\-matching\_\-terms\_\-end} (\hyperlink{types_8h_53073891e45d892a8d8a5d8f87f41402}{Xapian::docid}) const \begin{CompactList}\small\item\em End iterator corresponding to \hyperlink{classXapian_1_1Enquire_dda4181ccd15beb52c39f5e24adbb25b}{get\_\-matching\_\-terms\_\-begin()}. \item\end{CompactList}\item \hyperlink{classXapian_1_1TermIterator}{Term\-Iterator} \hyperlink{classXapian_1_1Enquire_4d531a494be857ae09c831480ff651d7}{get\_\-matching\_\-terms\_\-begin} (const \hyperlink{classXapian_1_1MSetIterator}{MSet\-Iterator} \&it) const \begin{CompactList}\small\item\em Get terms which match a given document, by match set item. \item\end{CompactList}\item \hyperlink{classXapian_1_1TermIterator}{Term\-Iterator} \hyperlink{classXapian_1_1Enquire_619e5a4f3597ed800e8f11190a5b7fe0}{get\_\-matching\_\-terms\_\-end} (const \hyperlink{classXapian_1_1MSetIterator}{MSet\-Iterator} \&) const \begin{CompactList}\small\item\em End iterator corresponding to \hyperlink{classXapian_1_1Enquire_dda4181ccd15beb52c39f5e24adbb25b}{get\_\-matching\_\-terms\_\-begin()}. \item\end{CompactList}\item void \hyperlink{classXapian_1_1Enquire_d206c52facbc0d9025129a7fcd83519e}{register\_\-match\_\-decider} (const std::string \&name, const \hyperlink{classXapian_1_1MatchDecider}{Match\-Decider} $\ast$mdecider=NULL)\begin{CompactList}\small\item\em Register a \hyperlink{classXapian_1_1MatchDecider}{Match\-Decider}. \item\end{CompactList}\item std::string \hyperlink{classXapian_1_1Enquire_4a980eb2599afdf52ae78788849c9921}{get\_\-description} () const \begin{CompactList}\small\item\em Introspection method. \item\end{CompactList}\end{CompactItemize}\subsection*{Public Attributes}\begin{CompactItemize}\item \hypertarget{classXapian_1_1Enquire_9b6a090ad836e57e918c271a872507a3}{\hyperlink{classXapian_1_1Internal_1_1RefCntPtr}{Xapian::Internal::Ref\-Cnt\-Ptr}$<$ Internal $>$ {\bf internal}}\label{classXapian_1_1Enquire_9b6a090ad836e57e918c271a872507a3}\end{CompactItemize}\subsection*{Static Public Attributes}\begin{CompactItemize}\item \hypertarget{classXapian_1_1Enquire_c5d1288d8cb6b6daf5170191c57fc1fb}{static const int {\bf include\_\-query\_\-terms} = 1}\label{classXapian_1_1Enquire_c5d1288d8cb6b6daf5170191c57fc1fb}\item \hypertarget{classXapian_1_1Enquire_666247bd6d07626ef973a6e99fda3893}{static const int {\bf use\_\-exact\_\-termfreq} = 2}\label{classXapian_1_1Enquire_666247bd6d07626ef973a6e99fda3893}\end{CompactItemize}\subsection{Detailed Description}This class provides an interface to the information retrieval system for the purpose of searching. Databases are usually opened lazily, so exceptions may not be thrown where you would expect them to be. You should catch \hyperlink{classXapian_1_1Error}{Xapian::Error} exceptions when calling any method in \hyperlink{classXapian_1_1Enquire}{Xapian::Enquire}.\begin{Desc}\item[Exceptions:]\begin{description}\item[{\em Xapian::Invalid\-Argument\-Error}]will be thrown if an invalid argument is supplied, for example, an unknown database type. \end{description}\end{Desc}\subsection{Constructor \& Destructor Documentation}\hypertarget{classXapian_1_1Enquire_7571e81ebfd755f5f84c674684229431}{\index{Xapian::Enquire@{Xapian::Enquire}!Enquire@{Enquire}}\index{Enquire@{Enquire}!Xapian::Enquire@{Xapian::Enquire}}\subsubsection[Enquire]{\setlength{\rightskip}{0pt plus 5cm}Xapian::Enquire::Enquire (const \hyperlink{classXapian_1_1Database}{Database} \& {\em databases}, \hyperlink{classXapian_1_1ErrorHandler}{Error\-Handler} $\ast$ {\em errorhandler\_\-} = {\tt 0})}}\label{classXapian_1_1Enquire_7571e81ebfd755f5f84c674684229431}Create a \hyperlink{classXapian_1_1Enquire}{Xapian::Enquire} object. This specification cannot be changed once the \hyperlink{classXapian_1_1Enquire}{Xapian::Enquire} is opened: you must create a new \hyperlink{classXapian_1_1Enquire}{Xapian::Enquire} object to access a different database, or set of databases.\begin{Desc}\item[Parameters:]\begin{description}\item[{\em database}]Specification of the database or databases to use. \item[{\em errorhandler\_\-}]A pointer to the error handler to use. Ownership of the object pointed to is not assumed by the \hyperlink{classXapian_1_1Enquire}{Xapian::Enquire} object - the user should delete the \hyperlink{classXapian_1_1ErrorHandler}{Xapian::Error\-Handler} object after the \hyperlink{classXapian_1_1Enquire}{Xapian::Enquire} object is deleted. To use no error handler, this parameter should be 0. \end{description}\end{Desc}\hypertarget{classXapian_1_1Enquire_808479faae76453f34a24881805e75b9}{\index{Xapian::Enquire@{Xapian::Enquire}!~Enquire@{$\sim$Enquire}}\index{~Enquire@{$\sim$Enquire}!Xapian::Enquire@{Xapian::Enquire}}\subsubsection[$\sim$Enquire]{\setlength{\rightskip}{0pt plus 5cm}Xapian::Enquire::$\sim$Enquire ()}}\label{classXapian_1_1Enquire_808479faae76453f34a24881805e75b9}Close the \hyperlink{classXapian_1_1Enquire}{Xapian::Enquire} object. \subsection{Member Function Documentation}\hypertarget{classXapian_1_1Enquire_4a980eb2599afdf52ae78788849c9921}{\index{Xapian::Enquire@{Xapian::Enquire}!get_description@{get\_\-description}}\index{get_description@{get\_\-description}!Xapian::Enquire@{Xapian::Enquire}}\subsubsection[get\_\-description]{\setlength{\rightskip}{0pt plus 5cm}std::string Xapian::Enquire::get\_\-description () const}}\label{classXapian_1_1Enquire_4a980eb2599afdf52ae78788849c9921}Introspection method. \begin{Desc}\item[Returns:]A string representing the enquire object. \end{Desc}\hypertarget{classXapian_1_1Enquire_f73e3672a3f1077309fbc99ef2db5412}{\index{Xapian::Enquire@{Xapian::Enquire}!get_eset@{get\_\-eset}}\index{get_eset@{get\_\-eset}!Xapian::Enquire@{Xapian::Enquire}}\subsubsection[get\_\-eset]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{classXapian_1_1ESet}{ESet} Xapian::Enquire::get\_\-eset (\hyperlink{types_8h_6979d98ebbe67186bd31e5ee2a7585cb}{Xapian::termcount} {\em maxitems}, const \hyperlink{classXapian_1_1RSet}{RSet} \& {\em omrset}, const \hyperlink{classXapian_1_1ExpandDecider}{Xapian::Expand\-Decider} $\ast$ {\em edecider}) const\hspace{0.3cm}{\tt \mbox{[}inline\mbox{]}}}}\label{classXapian_1_1Enquire_f73e3672a3f1077309fbc99ef2db5412}Get the expand set for the given rset. \begin{Desc}\item[Parameters:]\begin{description}\item[{\em maxitems}]the maximum number of items to return. \item[{\em omrset}]the relevance set to use when performing the expand operation. \item[{\em edecider}]a decision functor to use to decide whether a given term should be put in the \hyperlink{classXapian_1_1ESet}{ESet}\end{description}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -