|
a/src/rcldb/searchdata.h |
|
b/src/rcldb/searchdata.h |
|
... |
|
... |
71 |
*/
|
71 |
*/
|
72 |
class SearchData {
|
72 |
class SearchData {
|
73 |
public:
|
73 |
public:
|
74 |
SearchData(SClType tp)
|
74 |
SearchData(SClType tp)
|
75 |
: m_tp(tp), m_haveDates(false), m_haveWildCards(false)
|
75 |
: m_tp(tp), m_haveDates(false), m_haveWildCards(false)
|
76 |
{}
|
76 |
{
|
|
|
77 |
if (m_tp != SCLT_OR && m_tp != SCLT_AND)
|
|
|
78 |
m_tp = SCLT_OR;
|
|
|
79 |
}
|
77 |
~SearchData() {erase();}
|
80 |
~SearchData() {erase();}
|
78 |
|
81 |
|
79 |
/** Make pristine */
|
82 |
/** Make pristine */
|
80 |
void erase();
|
83 |
void erase();
|
81 |
|
84 |
|
|
... |
|
... |
88 |
/** Translate to Xapian query. rcldb knows about the void* */
|
91 |
/** Translate to Xapian query. rcldb knows about the void* */
|
89 |
bool toNativeQuery(Rcl::Db &db, void *);
|
92 |
bool toNativeQuery(Rcl::Db &db, void *);
|
90 |
|
93 |
|
91 |
/** We become the owner of cl and will delete it */
|
94 |
/** We become the owner of cl and will delete it */
|
92 |
bool addClause(SearchDataClause *cl);
|
95 |
bool addClause(SearchDataClause *cl);
|
|
|
96 |
|
|
|
97 |
/** If this is a simple query (one field only, no distance clauses),
|
|
|
98 |
add phrase made of query terms to query, so that docs containing the
|
|
|
99 |
user terms in order will have higher relevance. This must be called
|
|
|
100 |
before toNativeQuery().
|
|
|
101 |
*/
|
|
|
102 |
bool maybeAddAutoPhrase();
|
93 |
|
103 |
|
94 |
/** Set/get top subdirectory for filtering results */
|
104 |
/** Set/get top subdirectory for filtering results */
|
95 |
void setTopdir(const string& t) {m_topdir = t;}
|
105 |
void setTopdir(const string& t) {m_topdir = t;}
|
96 |
string getTopdir() {return m_topdir;}
|
106 |
string getTopdir() {return m_topdir;}
|
97 |
|
107 |
|
|
... |
|
... |
205 |
}
|
215 |
}
|
206 |
virtual void getUTerms(vector<string>& terms) const
|
216 |
virtual void getUTerms(vector<string>& terms) const
|
207 |
{
|
217 |
{
|
208 |
terms.insert(terms.end(), m_uterms.begin(), m_uterms.end());
|
218 |
terms.insert(terms.end(), m_uterms.begin(), m_uterms.end());
|
209 |
}
|
219 |
}
|
|
|
220 |
virtual const string& gettext() {return m_text;}
|
|
|
221 |
virtual const string& getfield() {return m_field;}
|
210 |
protected:
|
222 |
protected:
|
211 |
string m_text; // Raw user entry text.
|
223 |
string m_text; // Raw user entry text.
|
212 |
string m_field; // Field specification if any
|
224 |
string m_field; // Field specification if any
|
213 |
// Single terms and phrases resulting from breaking up m_text;
|
225 |
// Single terms and phrases resulting from breaking up m_text;
|
214 |
// valid after toNativeQuery() call
|
226 |
// valid after toNativeQuery() call
|