xapian-core  1.4.26
multimatch.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2002,2003,2004,2005,2006,2007,2009,2011,2013,2014,2015,2016 Olly Betts
6  * Copyright 2009 Lemur Consulting Ltd
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
21  * USA
22  */
23 
24 #ifndef OM_HGUARD_MULTIMATCH_H
25 #define OM_HGUARD_MULTIMATCH_H
26 
27 #include "submatch.h"
28 
29 #include <vector>
30 
31 #include "xapian/query.h"
32 #include "xapian/weight.h"
33 
35 {
36  private:
38  std::vector<Xapian::Internal::intrusive_ptr<SubMatch> > leaves;
39 
41 
43 
45 
47 
49 
50  double weight_cutoff;
51 
53 
55 
57 
59 
60  double time_limit;
61 
64 
69 
71  vector<bool> is_remote;
72 
74  const vector<Xapian::Internal::opt_intrusive_ptr<Xapian::MatchSpy>> & matchspies;
75 
80  double getorrecalc_maxweight(PostList *pl);
81 
83  MultiMatch(const MultiMatch &);
84 
86  void operator=(const MultiMatch &);
87 
88  public:
103  MultiMatch(const Xapian::Database &db_,
104  const Xapian::Query & query,
105  Xapian::termcount qlen,
106  const Xapian::RSet * omrset,
107  Xapian::doccount collapse_max_,
108  Xapian::valueno collapse_key_,
109  int percent_cutoff_,
110  double weight_cutoff_,
112  Xapian::valueno sort_key_,
114  bool sort_value_forward_,
115  double time_limit_,
116  Xapian::Weight::Internal & stats,
117  const Xapian::Weight *wtscheme,
118  const vector<Xapian::Internal::opt_intrusive_ptr<Xapian::MatchSpy>> & matchspies_,
119  bool have_sorter, bool have_mdecider);
120 
125  void get_mset(Xapian::doccount first,
126  Xapian::doccount maxitems,
127  Xapian::doccount check_at_least,
128  Xapian::MSet & mset,
129  Xapian::Weight::Internal & stats,
130  const Xapian::MatchDecider * mdecider,
131  const Xapian::KeyMaker * sorter);
132 
137  recalculate_w_max = true;
138  }
139 
140  bool full_db_has_positions() const {
141  return db.has_positions();
142  }
143 };
144 
145 #endif /* OM_HGUARD_MULTIMATCH_H */
Xapian::Query query
Definition: multimatch.h:42
bool full_db_has_positions() const
Definition: multimatch.h:140
MultiMatch(const MultiMatch &)
Copying is not permitted.
Abstract base class for postlists.
Definition: postlist.h:37
double time_limit
Definition: multimatch.h:60
This class is used to access a database, or a group of databases.
Definition: database.h:68
Xapian::Enquire::Internal::sort_setting sort_by
Definition: multimatch.h:56
Xapian::valueno collapse_key
Definition: multimatch.h:46
const vector< Xapian::Internal::opt_intrusive_ptr< Xapian::MatchSpy > > & matchspies
The matchspies to use.
Definition: multimatch.h:74
bool has_positions() const
Does this database have any positional information?
Definition: omdatabase.cc:238
Xapian::valueno sort_key
Definition: multimatch.h:54
Class representing a list of search results.
Definition: mset.h:44
const Xapian::Weight * weight
Weighting scheme.
Definition: multimatch.h:63
vector< bool > is_remote
Is each sub-database remote?
Definition: multimatch.h:71
std::vector< Xapian::Internal::intrusive_ptr< SubMatch > > leaves
Vector of the items.
Definition: multimatch.h:38
Xapian::Query API class.
void operator=(const MultiMatch &)
Assignment is not permitted.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
const Xapian::Database db
Definition: multimatch.h:40
Xapian::Enquire::docid_order order
Definition: multimatch.h:52
base class for sub-matchers
Class to hold statistics for a given collection.
void recalc_maxweight()
Called by postlists to indicate that they&#39;ve rearranged themselves and the maxweight now possible is ...
Definition: multimatch.h:136
void get_mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount check_at_least, Xapian::MSet &mset, Xapian::Weight::Internal &stats, const Xapian::MatchDecider *mdecider, const Xapian::KeyMaker *sorter)
Run the match and generate an MSet object.
Definition: multimatch.cc:384
int percent_cutoff
Definition: multimatch.h:48
Weighting scheme API.
bool sort_value_forward
Definition: multimatch.h:58
Base class for matcher decision functor.
Definition: enquire.h:118
bool recalculate_w_max
Internal flag to note that w_max needs to be recalculated while query is running. ...
Definition: multimatch.h:68
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
double getorrecalc_maxweight(PostList *pl)
get the maxweight that the postlist pl may return, calling recalc_maxweight if recalculate_w_max is s...
Definition: multimatch.cc:358
double weight_cutoff
Definition: multimatch.h:50
unsigned valueno
The number for a value slot in a document.
Definition: types.h:108
Class representing a query.
Definition: query.h:46
docid_order
Ordering of docids.
Definition: enquire.h:326
Xapian::doccount collapse_max
Definition: multimatch.h:44
Virtual base class for key making functors.
Definition: keymaker.h:41
A relevance set (R-Set).
Definition: enquire.h:60
Abstract base class for weighting schemes.
Definition: weight.h:35