xapian-core  1.4.26
localsubmatch.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2006,2007,2009,2010,2011,2013,2014,2015,2016,2018 Olly Betts
5  * Copyright (C) 2007 Lemur Consulting Ltd
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef XAPIAN_INCLUDED_LOCALSUBMATCH_H
23 #define XAPIAN_INCLUDED_LOCALSUBMATCH_H
24 
25 #include "backends/database.h"
26 #include "debuglog.h"
27 #include "api/leafpostlist.h"
28 #include "api/queryinternal.h"
29 #include "submatch.h"
30 #include "xapian/enquire.h"
31 #include "xapian/weight.h"
32 
33 class LeafPostList;
34 
35 class LocalSubMatch : public SubMatch {
37  void operator=(const LocalSubMatch &);
38 
41 
44 
47 
50 
53 
59 
62 
65 
66  public:
69  const Xapian::Query & query_,
70  Xapian::termcount qlen_,
71  const Xapian::RSet & rset_,
72  const Xapian::Weight* wt_factory_,
73  Xapian::doccount shard_index_)
74  : stats(NULL), query(query_), qlen(qlen_), db(db_), rset(rset_),
75  wt_factory(wt_factory_),
76  shard_index(shard_index_)
77  {
78  LOGCALL_CTOR(MATCH, "LocalSubMatch", db_ | query_ | qlen_ | rset_ | wt_factory_);
79  }
80 
82  bool prepare_match(bool nowait, Xapian::Weight::Internal & total_stats);
83 
85  void start_match(Xapian::doccount first,
86  Xapian::doccount maxitems,
87  Xapian::doccount check_at_least,
88  Xapian::Weight::Internal & total_stats);
89 
91  PostList * get_postlist(MultiMatch *matcher,
92  Xapian::termcount* total_subqs_ptr,
93  Xapian::Weight::Internal& total_stats);
94 
98  double factor,
99  bool wdf_disjoint);
100 
101  LeafPostList * open_post_list(const std::string& term,
102  Xapian::termcount wqf,
103  double factor,
104  bool need_positions,
105  bool in_synonym,
106  QueryOptimiser * qopt,
107  bool lazy_weight);
108 };
109 
110 #endif /* XAPIAN_INCLUDED_LOCALSUBMATCH_H */
Abstract base class for postlists.
Definition: postlist.h:37
Xapian::termcount qlen
The query length (used by some weighting schemes).
Definition: localsubmatch.h:49
Xapian::Query internals.
const Xapian::Database::Internal * db
The (sub-)Database we're searching.
Definition: localsubmatch.h:52
Base class for databases.
Definition: database.h:57
Abstract base class for leaf postlists.
Definition: leafpostlist.h:39
Abstract base class for leaf postlists.
bool prepare_match(bool nowait, Xapian::Weight::Internal &total_stats)
Fetch and collate statistics.
LocalSubMatch(const LocalSubMatch &)
Don't allow copying.
API for running queries.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
void operator=(const LocalSubMatch &)
Don't allow assignment.
const Xapian::Weight * wt_factory
Weight object (used as a factory by calling create on it).
Definition: localsubmatch.h:61
PostList * get_postlist(MultiMatch *matcher, Xapian::termcount *total_subqs_ptr, Xapian::Weight::Internal &total_stats)
Get PostList.
base class for sub-matchers
Class to hold statistics for a given collection.
Xapian::RSet rset
The RSet (used to calculate R and r).
Definition: localsubmatch.h:58
#define LOGCALL_CTOR(CATEGORY, CLASS, PARAMS)
Definition: debuglog.h:489
Xapian::Query query
The query.
Definition: localsubmatch.h:46
Weighting scheme API.
LocalSubMatch(const Xapian::Database::Internal *db_, const Xapian::Query &query_, Xapian::termcount qlen_, const Xapian::RSet &rset_, const Xapian::Weight *wt_factory_, Xapian::doccount shard_index_)
Constructor.
Definition: localsubmatch.h:68
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
Xapian::doccount shard_index
0-based index for the subdatabase.
Definition: localsubmatch.h:64
LeafPostList * open_post_list(const std::string &term, Xapian::termcount wqf, double factor, bool need_positions, bool in_synonym, QueryOptimiser *qopt, bool lazy_weight)
Xapian::Weight::Internal * stats
The statistics for the collection.
Definition: localsubmatch.h:43
PostList * make_synonym_postlist(PostList *or_pl, MultiMatch *matcher, double factor, bool wdf_disjoint)
Convert a postlist into a synonym postlist.
Class representing a query.
Definition: query.h:46
Debug logging macros.
void start_match(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount check_at_least, Xapian::Weight::Internal &total_stats)
Start the match.
A relevance set (R-Set).
Definition: enquire.h:60
Abstract base class for weighting schemes.
Definition: weight.h:35