xapian-core  1.4.26
msetpostlist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2006,2007,2008,2009,2011,2015 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef XAPIAN_INCLUDED_MSETPOSTLIST_H
22 #define XAPIAN_INCLUDED_MSETPOSTLIST_H
23 
24 #include "xapian/enquire.h"
25 
26 #include "api/omenquireinternal.h"
27 #include "api/postlist.h"
28 
35 class MSetPostList : public PostList {
37  void operator=(const MSetPostList &);
38 
40  MSetPostList(const MSetPostList &);
41 
43  int cursor;
44 
47 
53 
54  public:
55  MSetPostList(const Xapian::MSet mset, bool decreasing_relevance_)
56  : cursor(-1), mset_internal(mset.internal),
57  decreasing_relevance(decreasing_relevance_) { }
58 
60 
62 
64 
65  double get_maxweight() const;
66 
67  Xapian::docid get_docid() const;
68 
69  double get_weight() const;
70 
71  const std::string * get_sort_key() const;
72 
73  const std::string * get_collapse_key() const;
74 
77 
79 
80  double recalc_maxweight();
81 
82  PostList *next(double w_min);
83 
85  PostList *skip_to(Xapian::docid did, double w_min);
86 
87  bool at_end() const;
88 
89  std::string get_description() const;
90 };
91 
92 #endif /* XAPIAN_INCLUDED_MSETPOSTLIST_H */
bool decreasing_relevance
Is the sort order such the relevance decreases down the MSet?
Definition: msetpostlist.h:52
Abstract base class for postlists.
Definition: postlist.h:37
const std::string * get_sort_key() const
Definition: msetpostlist.cc:90
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
Definition: msetpostlist.cc:33
MSetPostList(const MSetPostList &)
Don't allow copying.
void operator=(const MSetPostList &)
Don't allow assignment.
Class representing a list of search results.
Definition: mset.h:44
Xapian::docid get_docid() const
Return the current docid.
Definition: msetpostlist.cc:74
Abstract base class for postlists.
bool at_end() const
Return true if the current position is past the last entry in this list.
API for running queries.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
std::string get_description() const
Return a string description of this object.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
double get_maxweight() const
Return an upper bound on what get_weight() can return.
Definition: msetpostlist.cc:54
int cursor
The MSet element that this PostList is pointing to.
Definition: msetpostlist.h:43
Internal * next()
Advance the current position to the next document in the postlist.
Definition: postlist.h:194
PostList returning entries from an MSet.
Definition: msetpostlist.h:35
Xapian::termcount get_doclength() const
Not implemented for MSetPostList.
const std::string * get_collapse_key() const
If the collapse key is already known, return it.
Definition: msetpostlist.cc:98
double get_weight() const
Return the weight contribution for the current position.
Definition: msetpostlist.cc:82
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
Definition: msetpostlist.cc:40
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
Definition: msetpostlist.cc:47
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
MSetPostList(const Xapian::MSet mset, bool decreasing_relevance_)
Definition: msetpostlist.h:55
Xapian::Internal::intrusive_ptr< Xapian::MSet::Internal > mset_internal
The MSet::Internal object which we&#39;re returning entries from.
Definition: msetpostlist.h:46
Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
PostList * skip_to(Xapian::docid did, double w_min)
Not meaningful for MSetPostList.