|
xapian-core
2.0.0
|
#include <protomset.h>
Collaboration diagram for ProtoMSet:Classes | |
| class | MCmpAdaptor |
| Adapt MSetCmp to be usable with min_heap. More... | |
Public Member Functions | |
| ProtoMSet (Xapian::doccount first_, Xapian::doccount max_items, Xapian::doccount check_at_least_, MSetCmp mcmp_, Xapian::Enquire::Internal::sort_setting sort_by_, Xapian::termcount total_subqs_, PostListTree &pltree_, Xapian::valueno collapse_key, Xapian::doccount collapse_max, int percent_threshold_, double percent_threshold_factor_, double max_possible_, bool stop_once_full_, double time_limit) | |
| ProtoMSet (const ProtoMSet &)=delete | |
| ProtoMSet & | operator= (const ProtoMSet &)=delete |
| Collapser & | get_collapser () |
| bool | full () const |
| double | get_min_weight () const |
| void | update_max_weight (double weight) |
| bool | checked_enough () |
| bool | handle_min_weight_pending (bool finalising=false) |
| Resolve a pending min_weight change. More... | |
| bool | early_reject (Result &new_item, bool calculated_weight, SpyMaster &spymaster, const Xapian::Document &doc) |
| bool | process (Result &&new_item, ValueStreamDocument &vsdoc) |
| Process new_item. More... | |
| Xapian::doccount | add (Result &&item) |
| void | replace (Xapian::doccount old_item, Result &&b) |
| void | set_new_min_weight (double min_wt) |
| void | finalise_percentages () |
| Xapian::MSet | finalise (const Xapian::MatchDecider *mdecider, const std::vector< std::unique_ptr< LocalSubMatch >> &locals, const Xapian::VecUniquePtr< EstimateOp > &estimates) |
Private Member Functions | |
| Xapian::doccount | size () const |
Private Attributes | |
| Xapian::doccount | max_size |
| Maximum size the ProtoMSet needs to grow to. More... | |
| Xapian::doccount | check_at_least |
| Xapian::Enquire::Internal::sort_setting | sort_by |
| MSetCmp | mcmp |
| double | min_weight = 0.0 |
| Minimum threshold on the weight. More... | |
| double | max_weight = 0.0 |
| The highest document weight seen. More... | |
| bool | min_weight_pending = false |
| Xapian::doccount | known_matching_docs = 0 |
| Count of how many known matching documents have been processed so far. More... | |
| std::vector< Result > | results |
| The items in the proto-MSet. More... | |
| std::vector< Xapian::doccount > | min_heap |
| A heap of offsets into results. More... | |
| Xapian::doccount | first |
| First entry wanted in MSet. More... | |
| Xapian::termcount | total_subqs |
| How many weighted leaf subqueries there are. More... | |
| Xapian::termcount | max_weight_subqs_matched = 0 |
| The number of subqueries which matched to give max_weight. More... | |
| int | percent_threshold |
| double | percent_threshold_factor |
| double | percent_scale = 0.0 |
| PostListTree & | pltree |
| Collapser | collapser |
| double | max_possible |
| bool | stop_once_full |
| TimeOut | timeout |
Friends | |
| class | MCmpAdaptor |
Definition at line 38 of file protomset.h.
|
inline |
Definition at line 135 of file protomset.h.
|
delete |
|
inline |
Definition at line 346 of file protomset.h.
References Assert, checked_enough(), full(), handle_min_weight_pending(), known_matching_docs, Heap::make(), max_weight, mcmp, min_heap, min_weight, min_weight_pending, Xapian::Enquire::Internal::REL, Xapian::Enquire::Internal::REL_VAL, Heap::replace(), results, size(), sort_by, and update_max_weight().
Referenced by process().
|
inline |
Definition at line 187 of file protomset.h.
References check_at_least, known_matching_docs, max_size, TimeOut::timed_out(), and timeout.
Referenced by add(), early_reject(), handle_min_weight_pending(), and process().
|
inline |
Definition at line 250 of file protomset.h.
References checked_enough(), collapser, Result::get_weight(), PostListTree::get_weight(), known_matching_docs, mcmp, min_heap, pltree, results, and update_max_weight().
Referenced by Matcher::get_local_mset().
|
inline |
Definition at line 491 of file protomset.h.
References Assert, AssertEq, AssertRel, check_at_least, collapser, Estimates::est, Collapser::finalise(), finalise_percentages(), first, full(), Collapser::get_docs_considered(), Collapser::get_dups_ignored(), Collapser::get_matches_lower_bound(), known_matching_docs, Estimates::max, max_possible, max_weight, mcmp, Estimates::min, min_weight, percent_scale, percent_threshold, percent_threshold_factor, results, Xapian::Vec< T, COW, UNIQUEPTR, typename >::size(), size(), and Heap::sort().
Referenced by Matcher::get_local_mset().
|
inline |
Definition at line 472 of file protomset.h.
References Assert, handle_min_weight_pending(), max_weight, max_weight_subqs_matched, min_weight_pending, percent_scale, percent_threshold, percent_threshold_factor, results, set_new_min_weight(), and total_subqs.
Referenced by finalise().
|
inline |
Definition at line 172 of file protomset.h.
References max_size, and size().
Referenced by add(), finalise(), and process().
|
inline |
Definition at line 170 of file protomset.h.
References collapser.
|
inline |
Definition at line 174 of file protomset.h.
References min_weight.
Referenced by Matcher::get_local_mset().
|
inline |
Resolve a pending min_weight change.
Only called when there's a percentage weight cut-off.
Definition at line 202 of file protomset.h.
References Assert, check_at_least, checked_enough(), collapser, Xapian::Enquire::Internal::DOCID, known_matching_docs, min_weight, min_weight_pending, Xapian::Enquire::Internal::REL, Xapian::Enquire::Internal::REL_VAL, Collapser::result_has_moved(), results, size(), and sort_by.
Referenced by add(), and finalise_percentages().
|
inline |
Process new_item.
Conceptually this is "add new_item", but taking into account collapsing.
Definition at line 301 of file protomset.h.
References add(), Assert, Collapser::check(), checked_enough(), collapser, EMPTY, full(), Collapser::old_item, Collapser::process(), REJECT, REPLACE, replace(), results, stop_once_full, and update_max_weight().
Referenced by Matcher::get_local_mset().
|
inline |
Definition at line 408 of file protomset.h.
References Assert, min_heap, rare, results, and Heap::siftdown().
Referenced by process().
|
inline |
Definition at line 432 of file protomset.h.
References max_weight, min_heap, min_weight, min_weight_pending, and results.
Referenced by finalise_percentages(), Matcher::get_local_mset(), and update_max_weight().
|
inlineprivate |
Definition at line 132 of file protomset.h.
References results.
Referenced by add(), finalise(), full(), and handle_min_weight_pending().
|
inline |
Definition at line 176 of file protomset.h.
References PostListTree::count_matching_subqs(), max_weight, max_weight_subqs_matched, percent_threshold, percent_threshold_factor, pltree, and set_new_min_weight().
Referenced by add(), early_reject(), and process().
|
friend |
Definition at line 52 of file protomset.h.
|
private |
Definition at line 60 of file protomset.h.
Referenced by checked_enough(), finalise(), and handle_min_weight_pending().
|
private |
Definition at line 124 of file protomset.h.
Referenced by early_reject(), finalise(), get_collapser(), handle_min_weight_pending(), and process().
|
private |
|
private |
Count of how many known matching documents have been processed so far.
Used to implement "check_at_least".
Definition at line 92 of file protomset.h.
Referenced by add(), checked_enough(), early_reject(), finalise(), and handle_min_weight_pending().
|
private |
Definition at line 126 of file protomset.h.
Referenced by finalise().
|
private |
Maximum size the ProtoMSet needs to grow to.
This is the maximum rank we care about.
Definition at line 58 of file protomset.h.
Referenced by checked_enough(), full(), and ProtoMSet().
|
private |
The highest document weight seen.
This weight may not actually be present in results if we're not sorting primarily by relevance, or if min_weight > max_weight.
Definition at line 84 of file protomset.h.
Referenced by add(), finalise(), finalise_percentages(), set_new_min_weight(), and update_max_weight().
|
private |
The number of subqueries which matched to give max_weight.
Definition at line 114 of file protomset.h.
Referenced by finalise_percentages(), and update_max_weight().
|
private |
Definition at line 64 of file protomset.h.
Referenced by add(), early_reject(), finalise(), and ProtoMSet::MCmpAdaptor::operator()().
|
private |
A heap of offsets into results.
Created lazily once we actually need it.
Definition at line 101 of file protomset.h.
Referenced by add(), early_reject(), replace(), and set_new_min_weight().
|
private |
Minimum threshold on the weight.
If the primary result ordering is by decreasing relevance (i.e. sort_by is REL or REL_VAL) then once the min_heap kicks in this threshold is raised to the lowest weight in the proto-mset.
Enquire::set_cutoff() can also affect min_weight - an absolute threshold determines the initial value; a percentage threshold raises the threshold each time max_weight increases (unless it's already higher than the value the percentage threshold results in).
Definition at line 77 of file protomset.h.
Referenced by add(), finalise(), get_min_weight(), handle_min_weight_pending(), and set_new_min_weight().
|
private |
Definition at line 86 of file protomset.h.
Referenced by add(), finalise_percentages(), handle_min_weight_pending(), and set_new_min_weight().
|
private |
Definition at line 120 of file protomset.h.
Referenced by finalise(), and finalise_percentages().
|
private |
Definition at line 116 of file protomset.h.
Referenced by finalise(), finalise_percentages(), and update_max_weight().
|
private |
Definition at line 118 of file protomset.h.
Referenced by finalise(), finalise_percentages(), and update_max_weight().
|
private |
Definition at line 122 of file protomset.h.
Referenced by early_reject(), and update_max_weight().
|
private |
The items in the proto-MSet.
Definition at line 95 of file protomset.h.
Referenced by add(), early_reject(), finalise(), finalise_percentages(), handle_min_weight_pending(), ProtoMSet::MCmpAdaptor::operator()(), process(), ProtoMSet(), replace(), set_new_min_weight(), and size().
|
private |
Definition at line 62 of file protomset.h.
Referenced by add(), and handle_min_weight_pending().
|
private |
Definition at line 128 of file protomset.h.
Referenced by process().
|
private |
Definition at line 130 of file protomset.h.
Referenced by checked_enough().
|
private |
How many weighted leaf subqueries there are.
Used for scaling percentages when the highest weighted document doesn't "match all terms".
Definition at line 111 of file protomset.h.
Referenced by finalise_percentages().