33 template<
bool FORWARD_DID>
45 template<
bool FORWARD_DID>
49 return msetcmp_by_docid_inline<FORWARD_DID>(a, b);
53 template<
bool FORWARD_DID>
59 return msetcmp_by_docid_inline<FORWARD_DID>(a, b);
63 template<
bool FORWARD_VALUE,
bool FORWARD_DID>
68 if (sort_cmp > 0)
return FORWARD_VALUE;
69 if (sort_cmp < 0)
return !FORWARD_VALUE;
70 return msetcmp_by_docid_inline<FORWARD_DID>(a, b);
74 template<
bool FORWARD_VALUE,
bool FORWARD_DID>
79 if (sort_cmp > 0)
return FORWARD_VALUE;
80 if (sort_cmp < 0)
return !FORWARD_VALUE;
83 return msetcmp_by_docid_inline<FORWARD_DID>(a, b);
87 template<
bool FORWARD_VALUE,
bool FORWARD_DID>
94 if (sort_cmp > 0)
return FORWARD_VALUE;
95 if (sort_cmp < 0)
return !FORWARD_VALUE;
96 return msetcmp_by_docid_inline<FORWARD_DID>(a, b);
102 bool sort_val_reverse)
107 return msetcmp_by_docid<true>;
109 return msetcmp_by_docid<false>;
112 return msetcmp_by_relevance<true>;
114 return msetcmp_by_relevance<false>;
117 if (sort_val_reverse) {
118 return msetcmp_by_value<true, true>;
120 return msetcmp_by_value<false, true>;
123 if (sort_val_reverse) {
124 return msetcmp_by_value<true, false>;
126 return msetcmp_by_value<false, false>;
131 if (sort_val_reverse) {
132 return msetcmp_by_value_then_relevance<true, true>;
134 return msetcmp_by_value_then_relevance<false, true>;
137 if (sort_val_reverse) {
138 return msetcmp_by_value_then_relevance<true, false>;
140 return msetcmp_by_value_then_relevance<false, false>;
148 if (sort_val_reverse) {
149 return msetcmp_by_relevance_then_value<true, true>;
151 return msetcmp_by_relevance_then_value<false, true>;
154 if (sort_val_reverse) {
155 return msetcmp_by_relevance_then_value<true, false>;
157 return msetcmp_by_relevance_then_value<false, false>;
const std::string & get_sort_key() const
double get_weight() const
Xapian::docid get_docid() const
static bool msetcmp_by_docid_inline(const Result &a, const Result &b)
MSetCmp get_msetcmp_function(Xapian::Enquire::Internal::sort_setting sort_by, bool sort_forward, bool sort_val_reverse)
Select the appropriate msetcmp function.
static bool msetcmp_by_value(const Result &a, const Result &b)
static bool msetcmp_by_docid(const Result &a, const Result &b)
static bool msetcmp_by_relevance(const Result &a, const Result &b)
static bool msetcmp_by_relevance_then_value(const Result &a, const Result &b)
static bool msetcmp_by_value_then_relevance(const Result &a, const Result &b)
Result comparison functions.
bool(* MSetCmp)(const Result &, const Result &)
Various assertion macros.