a/src/rcldb/searchdata.h b/src/rcldb/searchdata.h
...
...
69
69
70
*/
70
*/
71
class SearchData {
71
class SearchData {
72
public:
72
public:
73
    SearchData(SClType tp) 
73
    SearchData(SClType tp) 
74
    : m_tp(tp), m_topdirexcl(false), m_topdirweight(1.0), 
75
      m_haveDates(false), m_maxSize(size_t(-1)),
74
    : m_tp(tp), m_haveDates(false), m_maxSize(size_t(-1)),
76
      m_minSize(size_t(-1)), m_haveWildCards(false) 
75
      m_minSize(size_t(-1)), m_haveWildCards(false) 
77
    {
76
    {
78
    if (m_tp != SCLT_OR && m_tp != SCLT_AND) 
77
    if (m_tp != SCLT_OR && m_tp != SCLT_AND) 
79
        m_tp = SCLT_OR;
78
        m_tp = SCLT_OR;
80
    }
79
    }
...
...
103
     *     (proportion of docs where they occur)    
102
     *     (proportion of docs where they occur)    
104
     */
103
     */
105
    bool maybeAddAutoPhrase(Rcl::Db &db, double threshold);
104
    bool maybeAddAutoPhrase(Rcl::Db &db, double threshold);
106
105
107
    /** Set/get top subdirectory for filtering results */
106
    /** Set/get top subdirectory for filtering results */
108
    void setTopdir(const std::string& t, bool excl = false, float w = 1.0) 
107
    void addDirSpec(const std::string& t, bool excl = false, float w = 1.0) 
109
    {
108
    {
110
  m_topdir = t;
109
  m_dirspecs.push_back(DirSpec(t, excl, w));
111
  m_topdirexcl = excl;
112
  m_topdirweight = w;
113
    }
110
    }
114
111
115
    void setMinSize(size_t size) {m_minSize = size;}
112
    void setMinSize(size_t size) {m_minSize = size;}
116
    void setMaxSize(size_t size) {m_maxSize = size;}
113
    void setMaxSize(size_t size) {m_maxSize = size;}
117
114
...
...
146
    std::vector<SearchDataClause*> m_query;
143
    std::vector<SearchDataClause*> m_query;
147
    // Restricted set of filetypes if not empty.
144
    // Restricted set of filetypes if not empty.
148
    std::vector<std::string>            m_filetypes; 
145
    std::vector<std::string>            m_filetypes; 
149
    // Excluded set of file types if not empty
146
    // Excluded set of file types if not empty
150
    std::vector<std::string>            m_nfiletypes;
147
    std::vector<std::string>            m_nfiletypes;
148
151
    // Restrict to subtree.
149
    // Restrict  to subtree or exclude one
152
    std::string                    m_topdir; 
150
    class DirSpec {
153
    bool                      m_topdirexcl; // Invert meaning
151
    public:
154
    float                     m_topdirweight; // affect weight instead of filter
152
  std::string dir; 
153
  bool        exclude; 
154
  // For positive spec: affect weight instead of filter
155
  float       weight;
156
  DirSpec(const std::string&d, bool x, float w)
157
      : dir(d), exclude(x), weight(w)
158
  {
159
  }
160
    };
161
    std::vector<DirSpec> m_dirspecs;
162
155
    bool                      m_haveDates;
163
    bool                      m_haveDates;
156
    DateInterval              m_dates; // Restrict to date interval
164
    DateInterval              m_dates; // Restrict to date interval
157
    size_t                    m_maxSize;
165
    size_t                    m_maxSize;
158
    size_t                    m_minSize;
166
    size_t                    m_minSize;
159
    // Printable expanded version of the complete query, retrieved/set
167
    // Printable expanded version of the complete query, retrieved/set