xapian-core  1.4.21
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 #include <map>
34 
35 class LeafPostList;
36 
37 class LocalSubMatch : public SubMatch {
39  void operator=(const LocalSubMatch &);
40 
43 
46 
49 
52 
55 
61 
64 
67 
68  public:
71  const Xapian::Query & query_,
72  Xapian::termcount qlen_,
73  const Xapian::RSet & rset_,
74  const Xapian::Weight* wt_factory_,
75  Xapian::doccount shard_index_)
76  : stats(NULL), query(query_), qlen(qlen_), db(db_), rset(rset_),
77  wt_factory(wt_factory_),
78  shard_index(shard_index_)
79  {
80  LOGCALL_CTOR(MATCH, "LocalSubMatch", db_ | query_ | qlen_ | rset_ | wt_factory_);
81  }
82 
84  bool prepare_match(bool nowait, Xapian::Weight::Internal & total_stats);
85 
87  void start_match(Xapian::doccount first,
88  Xapian::doccount maxitems,
89  Xapian::doccount check_at_least,
90  Xapian::Weight::Internal & total_stats);
91 
93  PostList * get_postlist(MultiMatch *matcher,
94  Xapian::termcount* total_subqs_ptr,
95  Xapian::Weight::Internal& total_stats);
96 
100  double factor,
101  bool wdf_disjoint);
102 
103  LeafPostList * open_post_list(const std::string& term,
104  Xapian::termcount wqf,
105  double factor,
106  bool need_positions,
107  bool in_synonym,
108  QueryOptimiser * qopt,
109  bool lazy_weight);
110 };
111 
112 #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:51
Xapian::Query internals.
const Xapian::Database::Internal * db
The (sub-)Database we&#39;re searching.
Definition: localsubmatch.h:54
Base class for databases.
Definition: database.h:56
Abstract base class for leaf postlists.
Definition: leafpostlist.h:38
Abstract base class for leaf postlists.
bool prepare_match(bool nowait, Xapian::Weight::Internal &total_stats)
Fetch and collate statistics.
LocalSubMatch(const LocalSubMatch &)
Don&#39;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&#39;t allow assignment.
const Xapian::Weight * wt_factory
Weight object (used as a factory by calling create on it).
Definition: localsubmatch.h:63
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:60
#define LOGCALL_CTOR(CATEGORY, CLASS, PARAMS)
Definition: debuglog.h:478
Xapian::Query query
The query.
Definition: localsubmatch.h:48
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:70
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:66
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:45
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