|
a/src/rcldb/searchdata.h |
|
b/src/rcldb/searchdata.h |
|
... |
|
... |
28 |
#include <string>
|
28 |
#include <string>
|
29 |
#include <vector>
|
29 |
#include <vector>
|
30 |
|
30 |
|
31 |
#include "rcldb.h"
|
31 |
#include "rcldb.h"
|
32 |
#include "refcntr.h"
|
32 |
#include "refcntr.h"
|
|
|
33 |
#include "smallut.h"
|
33 |
|
34 |
|
34 |
#ifndef NO_NAMESPACES
|
35 |
#ifndef NO_NAMESPACES
|
35 |
using std::vector;
|
36 |
using std::vector;
|
36 |
using std::string;
|
37 |
using std::string;
|
37 |
namespace Rcl {
|
38 |
namespace Rcl {
|
|
... |
|
... |
68 |
{SCLT_PHRASE, [this is a phrase]} or as {SCLT_XXX, ["this is a phrase"]}
|
69 |
{SCLT_PHRASE, [this is a phrase]} or as {SCLT_XXX, ["this is a phrase"]}
|
69 |
|
70 |
|
70 |
*/
|
71 |
*/
|
71 |
class SearchData {
|
72 |
class SearchData {
|
72 |
public:
|
73 |
public:
|
73 |
SearchData(SClType tp) : m_tp(tp), m_haveWildCards(false) {}
|
74 |
SearchData(SClType tp)
|
|
|
75 |
: m_tp(tp), m_haveDates(false), m_haveWildCards(false)
|
|
|
76 |
{}
|
74 |
~SearchData() {erase();}
|
77 |
~SearchData() {erase();}
|
75 |
|
78 |
|
76 |
/** Make pristine */
|
79 |
/** Make pristine */
|
77 |
void erase();
|
80 |
void erase();
|
78 |
|
81 |
|
|
... |
|
... |
85 |
/** Translate to Xapian query. rcldb knows about the void* */
|
88 |
/** Translate to Xapian query. rcldb knows about the void* */
|
86 |
bool toNativeQuery(Rcl::Db &db, void *);
|
89 |
bool toNativeQuery(Rcl::Db &db, void *);
|
87 |
|
90 |
|
88 |
/** We become the owner of cl and will delete it */
|
91 |
/** We become the owner of cl and will delete it */
|
89 |
bool addClause(SearchDataClause *cl);
|
92 |
bool addClause(SearchDataClause *cl);
|
|
|
93 |
|
|
|
94 |
/** Set/get top subdirectory for filtering results */
|
|
|
95 |
void setTopdir(const string& t) {m_topdir = t;}
|
|
|
96 |
string getTopdir() {return m_topdir;}
|
|
|
97 |
|
|
|
98 |
/** Set date span for filtering results */
|
|
|
99 |
void setDateSpan(DateInterval *dip) {m_dates = *dip; m_haveDates = true;}
|
|
|
100 |
|
|
|
101 |
/** Add file type for filtering results */
|
|
|
102 |
void addFiletype(const string& ft) {m_filetypes.push_back(ft);}
|
|
|
103 |
|
|
|
104 |
void setStemlang(const string& lang = "english") {m_stemlang = lang;}
|
90 |
|
105 |
|
91 |
/** Retrieve error description */
|
106 |
/** Retrieve error description */
|
92 |
string getReason() {return m_reason;}
|
107 |
string getReason() {return m_reason;}
|
93 |
|
108 |
|
94 |
/** Get terms and phrase/near groups. Used in the GUI for highlighting
|
109 |
/** Get terms and phrase/near groups. Used in the GUI for highlighting
|
|
... |
|
... |
105 |
* Get/set the description field which is retrieved from xapian after
|
120 |
* Get/set the description field which is retrieved from xapian after
|
106 |
* initializing the query. It is stored here for usage in the GUI.
|
121 |
* initializing the query. It is stored here for usage in the GUI.
|
107 |
*/
|
122 |
*/
|
108 |
string getDescription() {return m_description;}
|
123 |
string getDescription() {return m_description;}
|
109 |
void setDescription(const string& d) {m_description = d;}
|
124 |
void setDescription(const string& d) {m_description = d;}
|
110 |
/** Get/set top subdirectory for filtering results */
|
125 |
|
111 |
string getTopdir() {return m_topdir;}
|
|
|
112 |
void setTopdir(const string& t) {m_topdir = t;}
|
|
|
113 |
/** Add file type for filtering results */
|
|
|
114 |
void addFiletype(const string& ft) {m_filetypes.push_back(ft);}
|
|
|
115 |
void setStemlang(const string& lang = "english") {m_stemlang = lang;}
|
|
|
116 |
private:
|
126 |
private:
|
117 |
SClType m_tp; // Only SCLT_AND or SCLT_OR here
|
127 |
SClType m_tp; // Only SCLT_AND or SCLT_OR here
|
118 |
vector<SearchDataClause*> m_query;
|
128 |
vector<SearchDataClause*> m_query;
|
119 |
vector<string> m_filetypes; // Restrict to filetypes if set.
|
129 |
vector<string> m_filetypes; // Restrict to filetypes if set.
|
120 |
string m_topdir; // Restrict to subtree.
|
130 |
string m_topdir; // Restrict to subtree.
|
|
|
131 |
bool m_haveDates;
|
|
|
132 |
DateInterval m_dates; // Restrict to date interval
|
121 |
// Printable expanded version of the complete query, retrieved/set
|
133 |
// Printable expanded version of the complete query, retrieved/set
|
122 |
// from rcldb after the Xapian::setQuery() call
|
134 |
// from rcldb after the Xapian::setQuery() call
|
123 |
string m_description;
|
135 |
string m_description;
|
124 |
string m_reason;
|
136 |
string m_reason;
|
125 |
bool m_haveWildCards;
|
137 |
bool m_haveWildCards;
|