54 #ifdef XAPIAN_HAS_REMOTE_BACKEND 66 #ifdef HAVE_TIMER_CREATE 74 set_timeout_flag(
union sigval sv)
76 *(
reinterpret_cast<volatile bool*
>(sv.sival_ptr)) =
true;
84 #ifndef _POSIX_MONOTONIC_CLOCK 85 const clockid_t TIMEOUT_CLOCK = CLOCK_REALTIME;
92 const clockid_t TIMEOUT_CLOCK = CLOCK_REALTIME;
93 #elif defined __CYGWIN__ 101 const clockid_t TIMEOUT_CLOCK = CLOCK_REALTIME;
103 const clockid_t TIMEOUT_CLOCK = CLOCK_MONOTONIC;
109 volatile bool expired;
114 sev.sigev_notify = SIGEV_THREAD;
115 sev.sigev_notify_function = set_timeout_flag;
116 sev.sigev_notify_attributes = NULL;
117 sev.sigev_value.sival_ptr =
118 static_cast<void*
>(
const_cast<bool*
>(&expired));
119 if (
usual(timer_create(TIMEOUT_CLOCK, &sev, &timerid) == 0)) {
120 struct itimerspec interval;
121 interval.it_interval.tv_sec = 0;
122 interval.it_interval.tv_nsec = 0;
123 RealTime::to_timespec(limit, &interval.it_value);
124 if (
usual(timer_settime(timerid, 0, &interval, NULL) == 0)) {
128 timer_delete(timerid);
131 sev.sigev_notify = SIGEV_NONE;
135 if (sev.sigev_notify != SIGEV_NONE) {
136 timer_delete(timerid);
137 sev.sigev_notify = SIGEV_NONE;
141 bool timed_out()
const {
return expired; }
160 #if 0 // VAL_REL isn't currently used so avoid compiler warnings. 175 vector<Xapian::RSet> & subrsets)
178 if (rset && !rset->
empty()) {
179 if (number_of_subdbs == 1) {
181 subrsets.push_back(*rset);
185 subrsets.reserve(number_of_subdbs);
186 for (
size_t i = 0; i < number_of_subdbs; ++i) {
190 const set<Xapian::docid> & rsetitems = rset->
internal->get_items();
191 set<Xapian::docid>::const_iterator j;
192 for (j = rsetitems.begin(); j != rsetitems.end(); ++j) {
195 subrsets[subdatabase].add_document(local_docid);
200 subrsets.resize(number_of_subdbs);
202 Assert(subrsets.size() == number_of_subdbs);
229 vector<bool> prepared;
230 prepared.resize(leaves.size(),
false);
231 size_t unprepared = leaves.size();
234 for (
size_t leaf = 0; leaf < leaves.size(); ++leaf) {
235 if (prepared[leaf])
continue;
236 SubMatch * submatch = leaves[leaf].get();
238 prepared[leaf] =
true;
252 const std::vector<Xapian::Internal::opt_intrusive_ptr<Xapian::MatchSpy>> &
spies;
268 LOGCALL_VOID(MATCH,
"MultipleMatchSpy::operator()", doc | wt);
269 for (
auto i : spies) {
283 int percent_cutoff_,
double weight_cutoff_,
287 bool sort_value_forward_,
292 bool have_sorter,
bool have_mdecider)
293 : db(db_),
query(query_),
294 collapse_max(collapse_max_), collapse_key(collapse_key_),
295 percent_cutoff(percent_cutoff_), weight_cutoff(weight_cutoff_),
297 sort_key(sort_key_), sort_by(sort_by_),
298 sort_value_forward(sort_value_forward_),
299 time_limit(time_limit_),
301 is_remote(db.internal.size()),
302 matchspies(matchspies_)
304 LOGCALL_CTOR(MATCH,
"MultiMatch", db_ | query_ | qlen | omrset | collapse_max_ | collapse_key_ | percent_cutoff_ | weight_cutoff_ |
int(order_) | sort_key_ |
int(sort_by_) | sort_value_forward_ | time_limit_| stats | weight_ | matchspies_ | have_sorter | have_mdecider);
309 vector<Xapian::RSet> subrsets;
312 for (
size_t i = 0; i != number_of_subdbs; ++i) {
318 #ifdef XAPIAN_HAS_REMOTE_BACKEND 334 bool decreasing_relevance =
360 LOGCALL(MATCH,
double,
"MultiMatch::getorrecalc_maxweight", pl);
363 LOGLINE(MATCH,
"recalculating max weight");
379 LOGLINE(MATCH,
"max possible doc weight = " << wt);
392 AssertRel(check_at_least,>=,first + maxitems);
404 #ifdef XAPIAN_HAS_REMOTE_BACKEND 410 rem_match->
start_match(first, maxitems, check_at_least, stats);
417 for (
size_t i = 0; i !=
leaves.size(); ++i) {
419 #ifdef XAPIAN_HAS_REMOTE_BACKEND 427 remote_maxitems = check_at_least;
429 leaf->start_match(0, remote_maxitems, check_at_least, stats);
433 leaf->start_match(0, first + maxitems, check_at_least, stats);
437 vector<PostList *> postlists;
444 #ifdef XAPIAN_HAS_REMOTE_BACKEND 446 size_t n_remotes = 0;
450 for (
size_t i = 0; i !=
leaves.size(); ++i) {
456 PostList* pl =
leaves[i]->get_postlist(
this, &total_subqs_i, stats);
457 total_subqs = max(total_subqs, total_subqs_i);
458 #ifdef XAPIAN_HAS_REMOTE_BACKEND 463 remote_uncollapsed_upper_bound +=
469 <<
" definite matches in remote submatch " 470 "which aren't passed to local match");
472 definite_matches_not_seen -= first + maxitems;
476 postlists.push_back(pl);
479 for (
auto pl : postlists)
delete pl;
482 Assert(!postlists.empty());
489 AutoPtr<PostList> pl;
490 if (postlists.size() == 1) {
491 pl.reset(postlists.front());
496 LOGLINE(MATCH,
"pl = (" << pl->get_description() <<
")");
500 double greatest_wt = 0;
502 #ifdef XAPIAN_HAS_REMOTE_BACKEND 503 unsigned greatest_wt_subqs_db_num = UINT_MAX;
505 vector<Xapian::Internal::MSetItem> items;
508 const double max_possible = pl->recalc_maxweight();
510 LOGLINE(MATCH,
"pl = (" << pl->get_description() <<
")");
517 if (mdecider == NULL) {
521 matches_lower_bound = pl->get_termfreq_min();
531 matchspy = &multispy;
537 if (check_at_least == 0) {
554 uncollapsed_lower_bound,
556 max_possible, greatest_wt, items,
569 items.reserve(max_msize + 1);
582 percent_cutoff_factor -= DBL_EPSILON;
604 bool is_heap =
false;
609 if (
rare(recalculate_w_max)) {
610 if (min_weight > 0.0) {
612 LOGLINE(MATCH,
"*** TERMINATING EARLY (1)");
622 LOGLINE(MATCH,
"*** REPLACING ROOT");
624 if (min_weight > 0.0) {
629 LOGLINE(MATCH,
"*** TERMINATING EARLY (2)");
635 if (
rare(pl->at_end())) {
636 LOGLINE(MATCH,
"Reached end of potential matches");
644 bool calculated_weight =
false;
645 if (
sort_by != VAL || min_weight > 0.0) {
646 wt = pl->get_weight();
647 if (wt < min_weight) {
648 LOGLINE(MATCH,
"Rejecting potential match due to insufficient weight");
651 calculated_weight =
true;
655 vsdoc.set_document(did);
656 LOGLINE(MATCH,
"Candidate document id " << did <<
" wt " << wt);
658 if (check_at_least > first + maxitems && timeout.timed_out()) {
659 check_at_least = first + maxitems;
663 const string * ptr = pl->get_sort_key();
676 if (!mcmp(new_item, min_item)) {
677 if (mdecider == NULL && !collapser) {
680 LOGLINE(MATCH,
"Making note of match item which sorts lower than min_item");
682 if (!calculated_weight) wt = pl->get_weight();
684 matchspy->operator()(doc, wt);
686 if (wt > greatest_wt)
goto new_greatest_weight;
689 if (docs_matched >= check_at_least) {
691 LOGLINE(MATCH,
"Dropping candidate which sorts lower than min_item");
693 if (!calculated_weight) wt = pl->get_weight();
694 if (wt > greatest_wt)
goto new_greatest_weight;
700 LOGLINE(MATCH,
"Keeping candidate which sorts lower than min_item for further investigation");
705 if (matchspy != NULL || mdecider != NULL) {
706 const unsigned int multiplier =
db.
internal.size();
712 ++decider_considered;
713 if (mdecider && !mdecider->operator()(doc)) {
718 if (!calculated_weight) {
719 wt = pl->get_weight();
721 calculated_weight =
true;
723 matchspy->operator()(doc, wt);
728 if (!calculated_weight) {
730 wt = pl->get_weight();
739 res = collapser.
process(new_item, pl.get(), vsdoc, mcmp);
744 if (wt > greatest_wt)
goto new_greatest_weight;
761 double old_wt = old_item.
wt;
762 if (old_wt >= min_weight && mcmp(old_item, min_item)) {
766 vector<Xapian::Internal::MSetItem>::iterator i;
767 for (i = items.begin(); i != items.end(); ++i) {
768 if (i->did == olddid) {
769 LOGLINE(MATCH,
"collapse: removing " <<
790 if (items.size() >= max_msize) {
791 items.push_back(new_item);
794 make_heap(items.begin(), items.end(), mcmp);
796 push_heap<vector<Xapian::Internal::MSetItem>::iterator,
797 MSetCmp>(items.begin(), items.end(), mcmp);
799 pop_heap<vector<Xapian::Internal::MSetItem>::iterator,
800 MSetCmp>(items.begin(), items.end(), mcmp);
803 if (!items.empty()) {
805 min_item = items.front();
808 if (docs_matched >= check_at_least) {
813 if (
rare(max_possible == 0 && sort_forward)) {
819 if (
leaves.size() == 1)
break;
822 if (min_item.
wt > min_weight) {
823 LOGLINE(MATCH,
"Setting min_weight to " <<
824 min_item.
wt <<
" from " << min_weight);
825 min_weight = min_item.
wt;
830 LOGLINE(MATCH,
"*** TERMINATING EARLY (3)");
834 items.push_back(new_item);
836 if (
sort_by == REL && items.size() == max_msize) {
837 if (docs_matched >= check_at_least) {
841 if (
rare(max_possible == 0 && sort_forward)) {
847 if (
leaves.size() == 1)
break;
855 if (wt > greatest_wt) {
858 #ifdef XAPIAN_HAS_REMOTE_BACKEND 859 const unsigned int multiplier =
db.
internal.size();
860 unsigned int db_num = (did - 1) % multiplier;
864 greatest_wt_subqs_db_num = db_num;
868 greatest_wt_subqs_matched = pl->count_matching_subqs();
869 #ifdef XAPIAN_HAS_REMOTE_BACKEND 870 greatest_wt_subqs_db_num = UINT_MAX;
874 double w = wt * percent_cutoff_factor;
875 if (w > min_weight) {
879 make_heap<vector<Xapian::Internal::MSetItem>::iterator,
880 MSetCmp>(items.begin(), items.end(), mcmp);
882 while (!items.empty() && items.front().wt < min_weight) {
883 pop_heap<vector<Xapian::Internal::MSetItem>::iterator,
884 MSetCmp>(items.begin(), items.end(), mcmp);
885 Assert(items.back().wt < min_weight);
888 #ifdef XAPIAN_ASSERTIONS_PARANOID 889 vector<Xapian::Internal::MSetItem>::const_iterator i;
890 for (i = items.begin(); i != items.end(); ++i) {
891 Assert(i->wt >= min_weight);
902 double percent_scale = 0;
903 if (!items.empty() && greatest_wt > 0) {
904 #ifdef XAPIAN_HAS_REMOTE_BACKEND 905 if (greatest_wt_subqs_db_num != UINT_MAX) {
906 const unsigned int n = greatest_wt_subqs_db_num;
913 percent_scale = greatest_wt_subqs_matched / double(total_subqs);
914 percent_scale /= greatest_wt;
916 Assert(percent_scale > 0);
922 double min_wt = percent_cutoff_factor / percent_scale;
925 make_heap<vector<Xapian::Internal::MSetItem>::iterator,
926 MSetCmp>(items.begin(), items.end(), mcmp);
928 while (!items.empty() && items.front().wt < min_wt) {
929 pop_heap<vector<Xapian::Internal::MSetItem>::iterator,
930 MSetCmp>(items.begin(), items.end(), mcmp);
931 Assert(items.back().wt < min_wt);
934 #ifdef XAPIAN_ASSERTIONS_PARANOID 935 vector<Xapian::Internal::MSetItem>::const_iterator j;
936 for (j = items.begin(); j != items.end(); ++j) {
944 "docs_matched = " << docs_matched <<
945 ", definite_matches_not_seen = " << definite_matches_not_seen <<
946 ", matches_lower_bound = " << matches_lower_bound <<
947 ", matches_estimated = " << matches_estimated <<
948 ", matches_upper_bound = " << matches_upper_bound);
952 docs_matched += definite_matches_not_seen;
957 #ifdef XAPIAN_HAS_REMOTE_BACKEND 958 if (collapser && n_remotes) {
964 if (n_remotes ==
leaves.size()) {
967 uncollapsed_upper_bound = remote_uncollapsed_upper_bound;
972 uncollapsed_upper_bound += remote_uncollapsed_upper_bound;
973 if (uncollapsed_upper_bound < remote_uncollapsed_upper_bound ||
974 uncollapsed_upper_bound > num_docs) {
975 uncollapsed_upper_bound = num_docs;
980 if (items.size() < max_msize) {
983 LOGLINE(MATCH,
"items.size() = " << items.size() <<
984 ", max_msize = " << max_msize <<
", setting bounds equal");
985 Assert(definite_matches_not_seen == 0);
987 matches_lower_bound = matches_upper_bound = matches_estimated
989 if (collapser && matches_lower_bound > uncollapsed_lower_bound)
990 uncollapsed_lower_bound = matches_lower_bound;
991 }
else if (!collapser && docs_matched < check_at_least) {
994 LOGLINE(MATCH,
"Setting bounds equal");
995 matches_lower_bound = matches_upper_bound = matches_estimated
997 if (collapser && matches_lower_bound > uncollapsed_lower_bound)
998 uncollapsed_lower_bound = matches_lower_bound;
1000 AssertRel(matches_estimated,>=,matches_lower_bound);
1001 AssertRel(matches_estimated,<=,matches_upper_bound);
1006 double estimate_scale = 1.0;
1007 double unique_rate = 1.0;
1010 LOGLINE(MATCH,
"Adjusting bounds due to collapse_key");
1012 if (matches_lower_bound > uncollapsed_lower_bound)
1013 uncollapsed_lower_bound = matches_lower_bound;
1020 if (docs_considered > 0) {
1021 double unique = double(docs_considered - dups_ignored);
1022 unique_rate = unique / double(docs_considered);
1027 matches_upper_bound -= dups_ignored;
1029 LOGLINE(MATCH,
"matches_lower_bound=" << matches_lower_bound <<
1030 ", matches_estimated=" << matches_estimated <<
1031 "*" << estimate_scale <<
"*" << unique_rate <<
1032 ", matches_upper_bound=" << matches_upper_bound);
1041 matches_lower_bound = max(docs_matched, matches_lower_bound);
1048 if (decider_considered > 0) {
1049 double accept = double(decider_considered - decider_denied);
1050 double accept_rate = accept / double(decider_considered);
1051 estimate_scale *= accept_rate;
1058 matches_upper_bound -= decider_denied;
1059 if (collapser) uncollapsed_upper_bound -= decider_denied;
1063 estimate_scale *= (1.0 - percent_cutoff_factor);
1073 matches_lower_bound = items.size();
1074 if (collapser) uncollapsed_lower_bound = matches_lower_bound;
1079 LOGLINE(MATCH,
"Adjusted bounds due to percent_cutoff (" <<
1081 matches_estimated <<
", matches_lower_bound=" <<
1082 matches_lower_bound);
1085 if (collapser && estimate_scale != 1.0) {
1086 uncollapsed_estimated =
1090 estimate_scale *= unique_rate;
1092 if (estimate_scale != 1.0) {
1095 if (matches_estimated < matches_lower_bound)
1096 matches_estimated = matches_lower_bound;
1099 if (collapser || mdecider) {
1100 LOGLINE(MATCH,
"Clamping estimate between bounds: " 1101 "matches_lower_bound = " << matches_lower_bound <<
1102 ", matches_estimated = " << matches_estimated <<
1103 ", matches_upper_bound = " << matches_upper_bound);
1104 AssertRel(matches_lower_bound,<=,matches_upper_bound);
1105 matches_estimated = max(matches_estimated, matches_lower_bound);
1106 matches_estimated = min(matches_estimated, matches_upper_bound);
1108 AssertRel(docs_matched,<=,matches_upper_bound);
1109 if (docs_matched > matches_lower_bound)
1110 matches_lower_bound = docs_matched;
1111 if (docs_matched > matches_estimated)
1112 matches_estimated = docs_matched;
1116 AssertRel(docs_matched,<=,uncollapsed_upper_bound);
1117 if (docs_matched > uncollapsed_lower_bound)
1118 uncollapsed_lower_bound = docs_matched;
1123 AssertRel(uncollapsed_lower_bound,<=,uncollapsed_upper_bound);
1124 if (uncollapsed_estimated < uncollapsed_lower_bound) {
1125 uncollapsed_estimated = uncollapsed_lower_bound;
1126 }
else if (uncollapsed_estimated > uncollapsed_upper_bound) {
1127 uncollapsed_estimated = uncollapsed_upper_bound;
1131 uncollapsed_lower_bound = matches_lower_bound;
1132 uncollapsed_upper_bound = matches_upper_bound;
1133 uncollapsed_estimated = matches_estimated;
1136 LOGLINE(MATCH, items.size() <<
" items in potential mset");
1140 if (items.size() <= first) {
1143 LOGLINE(MATCH,
"finding " << first <<
"th");
1148 vector<Xapian::Internal::MSetItem>::reverse_iterator nth;
1149 nth = items.rbegin() + first;
1150 nth_element(items.rbegin(), nth, items.rend(), mcmp);
1152 items.erase(items.begin() + items.size() - first, items.end());
1156 LOGLINE(MATCH,
"sorting " << items.size() <<
" entries");
1165 sort(items.begin(), items.end(), mcmp);
1167 if (!items.empty()) {
1168 LOGLINE(MATCH,
"min weight in mset = " << items.back().wt);
1169 LOGLINE(MATCH,
"max weight in mset = " << items[0].wt);
1172 AssertRel(matches_estimated,>=,matches_lower_bound);
1173 AssertRel(matches_estimated,<=,matches_upper_bound);
1175 AssertRel(uncollapsed_estimated,>=,uncollapsed_lower_bound);
1176 AssertRel(uncollapsed_estimated,<=,uncollapsed_upper_bound);
1186 if (!items.empty() && collapser && !collapser.
empty()) {
1188 double min_wt = 0.0;
1189 if (percent_scale > 0.0)
1190 min_wt = percent_cutoff_factor / percent_scale;
1192 vector<Xapian::Internal::MSetItem>::iterator i;
1193 for (i = items.begin(); i != items.end(); ++i) {
1195 if (i->collapse_key.empty())
continue;
1199 if (--entries == 0) {
1208 matches_upper_bound,
1209 matches_lower_bound,
1211 uncollapsed_upper_bound,
1212 uncollapsed_lower_bound,
1213 uncollapsed_estimated,
1214 max_possible, greatest_wt, items,
1215 percent_scale * 100.0);
void get_mset(Xapian::MSet &mset)
Short-cut for single remote match.
MultiMatch(const MultiMatch &)
Copying is not permitted.
collapse_result process(Xapian::Internal::MSetItem &item, PostList *postlist, Xapian::Document::Internal &vsdoc, MSetCmp mcmp)
Handle a new MSetItem.
MultipleMatchSpy(const std::vector< Xapian::Internal::opt_intrusive_ptr< Xapian::MatchSpy >> &spies_)
Abstract base class for postlists.
Class which applies several match spies in turn.
This class is used to access a database, or a group of databases.
#define LOGCALL_STATIC_VOID(CATEGORY, FUNC, PARAMS)
unsigned timeout
A timeout value in milliseconds.
class for performing a match
Xapian::Enquire::Internal::sort_setting sort_by
#define AssertRel(A, REL, B)
A PostList which contains no entries.
Xapian::valueno collapse_key
Abstract base class for match spies.
double weight
The weight of a document or term.
A document which gets its values from a ValueStreamManager.
Base class for databases.
const vector< Xapian::Internal::opt_intrusive_ptr< Xapian::MatchSpy > > & matchspies
The matchspies to use.
Xapian::Internal::intrusive_ptr< Internal > internal
void set_query(const Xapian::Query &query_)
Class representing a list of search results.
virtual double recalc_maxweight()=0
Recalculate the upper bound on what get_weight() can return.
Collapse documents with the same collapse key during the match.
RemoteDatabase is the baseclass for remote database implementations.
#define LOGCALL_VOID(CATEGORY, FUNC, PARAMS)
const Xapian::Weight * weight
Weighting scheme.
vector< bool > is_remote
Is each sub-database remote?
std::vector< Xapian::Internal::intrusive_ptr< SubMatch > > leaves
Vector of the items.
std::vector< Xapian::Internal::intrusive_ptr< Internal > > internal
Xapian::doccount get_doccount() const
Get the number of documents in the database.
A postlist comprising postlists from different databases merged together.
virtual bool prepare_match(bool nowait, Xapian::Weight::Internal &total_stats)=0
Fetch and collate statistics.
virtual void readahead_for_query(const Xapian::Query &query)
const std::vector< Xapian::Internal::opt_intrusive_ptr< Xapian::MatchSpy > > & spies
List of match spies to call, in order.
string sort_key
Used when sorting by value.
void operator()(const Xapian::Document &doc, double wt)
Implementation of virtual operator().
Xapian::Internal::intrusive_ptr< Internal > internal
Hierarchy of classes which Xapian can throw as exceptions.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
const Xapian::Database db
Xapian::doccount get_dups_ignored() const
bool(* MSetCmp)(const Xapian::Internal::MSetItem &, const Xapian::Internal::MSetItem &)
SubMatch class for a remote database.
virtual base class for branched types of postlist
merge postlists from different databases
Xapian::Weight::Internal class, holding database and term statistics.
Xapian::doccount get_uncollapsed_upper_bound() const
Get uncollapsed_upper_bound from the remote MSet.
Xapian::Enquire::docid_order order
virtual Xapian::doccount get_termfreq_min() const =0
Get a lower bound on the number of documents indexed by this term.
base class for sub-matchers
double wt
Weight calculated.
Class to hold statistics for a given collection.
string collapse_key
Value which was used to collapse upon.
void set_query(const Xapian::Query &query, Xapian::termcount qlen, Xapian::doccount collapse_max, Xapian::valueno collapse_key, Xapian::Enquire::docid_order order, Xapian::valueno sort_key, Xapian::Enquire::Internal::sort_setting sort_by, bool sort_value_forward, double time_limit, int percent_cutoff, double weight_cutoff, const Xapian::Weight *wtscheme, const Xapian::RSet &omrset, const vector< Xapian::Internal::opt_intrusive_ptr< Xapian::MatchSpy >> &matchspies)
Set the query.
An item resulting from a query.
const Xapian::Enquire::Internal::sort_setting VAL
virtual int get_backend_info(string *path) const =0
Get backend information about this database.
void get_mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount check_at_least, Xapian::MSet &mset, Xapian::Weight::Internal &stats, const Xapian::MatchDecider *mdecider, const Xapian::KeyMaker *sorter)
Run the match and generate an MSet object.
RemoteDatabase is the baseclass for remote database implementations.
SubMatch class for a local database.
static void prepare_sub_matches(vector< intrusive_ptr< SubMatch > > &leaves, Xapian::Weight::Internal &stats)
Prepare some SubMatches.
A document which gets its values from a ValueStreamManager.
#define LOGCALL_CTOR(CATEGORY, CLASS, PARAMS)
void set_bounds_from_db(const Xapian::Database &db_)
Set the "bounds" stats from Database db.
virtual double get_maxweight() const =0
Return an upper bound on what get_weight() can return.
Define preprocessor symbols for the library version.
const Xapian::Enquire::Internal::sort_setting REL_VAL
collapse_result
Enumeration reporting how a document was handled by the Collapser.
double get_percent_factor() const
Get percentage factor - only valid after get_postlist().
Base class for matcher decision functor.
bool recalculate_w_max
Internal flag to note that w_max needs to be recalculated while query is running. ...
static Xapian::Query query(Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
Xapian::doccount get_collapse_count(const std::string &collapse_key, int percent_cutoff, double min_weight) const
static void split_rset_by_db(const Xapian::RSet *rset, Xapian::doccount number_of_subdbs, vector< Xapian::RSet > &subrsets)
Split an RSet into several sub rsets, one for each database.
bool next_handling_prune(PostList *&pl, double w_min, MultiMatch *matcher)
virtual std::string get_description() const =0
Return a string description of this object.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
double getorrecalc_maxweight(PostList *pl)
get the maxweight that the postlist pl may return, calling recalc_maxweight if recalculate_w_max is s...
MSetItem comparison functions.
MSetCmp get_msetcmp_function(Xapian::Enquire::Internal::sort_setting sort_by, bool sort_forward, bool sort_val_reverse)
Select the appropriate msetcmp function.
bool empty() const
Check if this query is Xapian::Query::MatchNothing.
The Collapser class tracks collapse keys and the documents they match.
unsigned valueno
The number for a value slot in a document.
Xapian::doccount entries() const
void start_match(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount check_at_least, Xapian::Weight::Internal &total_stats)
Start the match.
const Xapian::Enquire::Internal::sort_setting REL
<unistd.h>, but with compat.
Xapian::doccount get_matches_lower_bound() const
Various assertion macros.
Functions for handling a time or time interval in a double.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Class representing a query.
Xapian::Internal::MSetItem old_item
Replaced item when REPLACED is returned by collapse().
bool empty() const
Test if this R-Set is empty.
A smart pointer that uses intrusive reference counting.
docid_order
Ordering of docids.
Xapian::doccount collapse_max
A handle representing a document in a Xapian database.
Class for performing matching on a remote database.
Wrapper around standard unique_ptr template.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)
Virtual base class for key making functors.
UnimplementedError indicates an attempt to use an unimplemented feature.
Xapian::doccount get_docs_considered() const
Abstract base class for weighting schemes.
docids sort in descending order.