Branch data Line data Source code
1 : : /** @file msetpostlist.h
2 : : * @brief PostList returning entries from an MSet
3 : : */
4 : : /* Copyright (C) 2006,2007,2008,2009 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 "omenquireinternal.h"
27 : : #include "postlist.h"
28 : :
29 : : /** PostList returning entries from an MSet.
30 : : *
31 : : * This class is used with the remote backend. We perform a match on the
32 : : * remote server, then serialise the resulting MSet and pass it back to the
33 : : * client where we include it in the match by wrapping it in an MSetPostList.
34 : : */
35 [ + - ][ # # ]: 156 : class MSetPostList : public PostList {
36 : : /// Don't allow assignment.
37 : : void operator=(const MSetPostList &);
38 : :
39 : : /// Don't allow copying.
40 : : MSetPostList(const MSetPostList &);
41 : :
42 : : /// The MSet element that this PostList is pointing to.
43 : : int cursor;
44 : :
45 : : /// The MSet::Internal object which we're returning entries from.
46 : : Xapian::Internal::RefCntPtr<Xapian::MSet::Internal> mset_internal;
47 : :
48 : : /** Is the sort order such the relevance decreases down the MSet?
49 : : *
50 : : * This is true for sort_by_relevance and sort_by_relevance_then_value.
51 : : */
52 : : bool decreasing_relevance;
53 : :
54 : : public:
55 : 156 : MSetPostList(const Xapian::MSet mset, bool decreasing_relevance_)
56 : : : cursor(-1), mset_internal(mset.internal),
57 : 156 : decreasing_relevance(decreasing_relevance_) { }
58 : :
59 : : Xapian::doccount get_termfreq_min() const;
60 : :
61 : : Xapian::doccount get_termfreq_est() const;
62 : :
63 : : Xapian::doccount get_termfreq_max() const;
64 : :
65 : : Xapian::weight get_maxweight() const;
66 : :
67 : : Xapian::docid get_docid() const;
68 : :
69 : : Xapian::weight get_weight() const;
70 : :
71 : : const string * get_collapse_key() const;
72 : :
73 : : /// Not implemented for MSetPostList.
74 : : Xapian::termcount get_doclength() const;
75 : :
76 : : Xapian::weight recalc_maxweight();
77 : :
78 : : PostList *next(Xapian::weight w_min);
79 : :
80 : : /// Not meaningful for MSetPostList.
81 : : PostList *skip_to(Xapian::docid did, Xapian::weight w_min);
82 : :
83 : : bool at_end() const;
84 : :
85 : : string get_description() const;
86 : : };
87 : :
88 : : #endif /* XAPIAN_INCLUDED_MSETPOSTLIST_H */
|