00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <config.h>
00022
00023 #include "msetpostlist.h"
00024 #include "omassert.h"
00025 #include "omdebug.h"
00026
00027 Xapian::doccount
00028 MSetPostList::get_termfreq_min() const
00029 {
00030 DEBUGCALL(MATCH, Xapian::doccount, "MSetPostList::get_termfreq_min", "");
00031 RETURN(mset_internal->matches_lower_bound);
00032 }
00033
00034 Xapian::doccount
00035 MSetPostList::get_termfreq_est() const
00036 {
00037 DEBUGCALL(MATCH, Xapian::doccount, "MSetPostList::get_termfreq_est", "");
00038 RETURN(mset_internal->matches_estimated);
00039 }
00040
00041 Xapian::doccount
00042 MSetPostList::get_termfreq_max() const
00043 {
00044 DEBUGCALL(MATCH, Xapian::doccount, "MSetPostList::get_termfreq_max", "");
00045 RETURN(mset_internal->matches_upper_bound);
00046 }
00047
00048 Xapian::weight
00049 MSetPostList::get_maxweight() const
00050 {
00051 DEBUGCALL(MATCH, Xapian::weight, "MSetPostList::get_maxweight", "");
00052
00053
00054 if (cursor == -1) RETURN(mset_internal->max_possible);
00055
00056
00057
00058 if (decreasing_relevance) RETURN(mset_internal->items[cursor].did);
00059
00060
00061 RETURN(mset_internal->max_attained);
00062 }
00063
00064 Xapian::docid
00065 MSetPostList::get_docid() const
00066 {
00067 DEBUGCALL(MATCH, Xapian::docid, "MSetPostList::get_docid", "");
00068 Assert(cursor != -1);
00069 RETURN(mset_internal->items[cursor].did);
00070 }
00071
00072 Xapian::weight
00073 MSetPostList::get_weight() const
00074 {
00075 DEBUGCALL(MATCH, Xapian::weight, "MSetPostList::get_weight", "");
00076 Assert(cursor != -1);
00077 RETURN(mset_internal->items[cursor].wt);
00078 }
00079
00080 const string *
00081 MSetPostList::get_collapse_key() const
00082 {
00083 DEBUGCALL(MATCH, string *, "MSetPostList::get_collapse_key", "");
00084 Assert(cursor != -1);
00085 RETURN(&mset_internal->items[cursor].collapse_key);
00086 }
00087
00088 Xapian::doclength
00089 MSetPostList::get_doclength() const
00090 {
00091 throw Xapian::UnimplementedError("MSetPostList::get_doclength() unimplemented");
00092 }
00093
00094 Xapian::weight
00095 MSetPostList::recalc_maxweight()
00096 {
00097 DEBUGCALL(MATCH, Xapian::weight, "MSetPostList::recalc_maxweight", "");
00098 RETURN(MSetPostList::get_maxweight());
00099 }
00100
00101 PostList *
00102 MSetPostList::next(Xapian::weight w_min)
00103 {
00104 DEBUGCALL(MATCH, PostList *, "MSetPostList::next", w_min);
00105 Assert(cursor == -1 || !at_end());
00106 ++cursor;
00107 if (decreasing_relevance) {
00108
00109
00110
00111 if (!at_end() && mset_internal->items[cursor].wt < w_min)
00112 cursor = mset_internal->items.size();
00113 } else {
00114
00115 while (!at_end() && mset_internal->items[cursor].wt < w_min)
00116 ++cursor;
00117 }
00118 RETURN(NULL);
00119 }
00120
00121 PostList *
00122 MSetPostList::skip_to(Xapian::docid, Xapian::weight)
00123 {
00124
00125
00126
00127 throw Xapian::InvalidOperationError("MSetPostList::skip_to not meaningful");
00128 }
00129
00130 bool
00131 MSetPostList::at_end() const
00132 {
00133 DEBUGCALL(MATCH, bool, "MSetPostList::at_end", "");
00134 Assert(cursor != -1);
00135 RETURN(size_t(cursor) >= mset_internal->items.size());
00136 }
00137
00138 string
00139 MSetPostList::get_description() const
00140 {
00141 string desc("(MSet ");
00142 desc += mset_internal->get_description();
00143 desc += ')';
00144 return desc;
00145 }