|
xapian-core
2.0.0
|
Class for estimating the total number of matching documents. More...
#include <estimateop.h>
Collaboration diagram for EstimateOp:Public Types | |
| enum | op_type { KNOWN , DECIDER = 1 , NEAR = 2 , PHRASE = 3 , EXACT_PHRASE = 4 , POSTING_SOURCE , AND , AND_NOT , OR , XOR } |
Public Member Functions | |
| EstimateOp (Xapian::doccount tf_, Xapian::docid first, Xapian::docid last) | |
| Leaf term. More... | |
| EstimateOp () | |
| PostingSource. More... | |
| EstimateOp (Estimates estimates_) | |
| Value range. More... | |
| EstimateOp (Xapian::doccount tf_) | |
| Value range degenerate case. More... | |
| EstimateOp (op_type type_, Xapian::docid first, Xapian::docid last, Xapian::VecUniquePtr< EstimateOp > &&sub_estimates_) | |
| AND, AND_NOT, OR or XOR. More... | |
| EstimateOp (op_type type_, Xapian::docid first, Xapian::docid last, std::unique_ptr< EstimateOp > &&est1, std::unique_ptr< EstimateOp > &&est2) | |
| AND, AND_NOT, OR or XOR (pair-wise). More... | |
| EstimateOp (op_type type_, EstimateOp *sub_estimate) | |
| DECIDER, NEAR, PHRASE or EXACT_PHRASE. More... | |
| void | report_first (Xapian::docid first) |
| Report the first docid indexed. More... | |
| void | report_ratio (Xapian::doccount accepted, Xapian::doccount rejected) |
| void | report_range_ratio (Xapian::doccount accepted, Xapian::doccount rejected) |
| Adjust static estimates for value range. More... | |
| void | report_termfreqs (Xapian::doccount min_, Xapian::doccount est, Xapian::doccount max_) |
| Fill in estimates for POSTING_SOURCE. More... | |
| Estimates | resolve (Xapian::doccount db_size, Xapian::docid db_first, Xapian::docid db_last) |
| unsigned | get_subquery_count () const |
Private Attributes | |
| op_type | type |
| Estimates | estimates |
| Estimates. More... | |
| Xapian::VecUniquePtr< EstimateOp > | sub_estimates |
Class for estimating the total number of matching documents.
We build a tree of EstimateOp objects which largely follows the Query tree/PostList tree, but there are some differences. Here we only care about the number of matches, so operations which only affect ordering are equivalent, so for example, we use OR here for any of OP_OR, OP_SYNONYM and OP_MAX; OP_AND_MAYBE and its RHS are omitted.
Definition at line 64 of file estimateop.h.
| enum EstimateOp::op_type |
| Enumerator | |
|---|---|
| KNOWN | |
| DECIDER | |
| NEAR | |
| PHRASE | |
| EXACT_PHRASE | |
| POSTING_SOURCE | |
| AND | |
| AND_NOT | |
| OR | |
| XOR | |
Definition at line 66 of file estimateop.h.
|
inline |
Leaf term.
Definition at line 95 of file estimateop.h.
|
inline |
PostingSource.
Definition at line 100 of file estimateop.h.
|
inline |
Value range.
Definition at line 104 of file estimateop.h.
|
inline |
Value range degenerate case.
Definition at line 108 of file estimateop.h.
|
inline |
AND, AND_NOT, OR or XOR.
Definition at line 112 of file estimateop.h.
References estimates, Estimates::first, and Estimates::last.
|
inline |
AND, AND_NOT, OR or XOR (pair-wise).
Definition at line 120 of file estimateop.h.
References estimates, Estimates::first, Estimates::last, and sub_estimates.
|
inline |
DECIDER, NEAR, PHRASE or EXACT_PHRASE.
These operate as filters so have a single subquery.
Definition at line 134 of file estimateop.h.
References sub_estimates.
|
inline |
Definition at line 201 of file estimateop.h.
References sub_estimates.
|
inline |
Report the first docid indexed.
Called by ValueRangePostList if it starts with next().
Definition at line 143 of file estimateop.h.
References estimates, and Estimates::first.
|
inline |
Adjust static estimates for value range.
Definition at line 158 of file estimateop.h.
References AssertEq, AssertRel, Estimates::est, estimates, KNOWN, Estimates::max, Estimates::min, and type.
|
inline |
Definition at line 147 of file estimateop.h.
References Assert, DECIDER, estimates, EXACT_PHRASE, Estimates::max, Estimates::min, NEAR, PHRASE, and type.
Referenced by SelectPostList::~SelectPostList().
|
inline |
Fill in estimates for POSTING_SOURCE.
Definition at line 186 of file estimateop.h.
References AssertEq, Estimates::est, estimates, Estimates::first, Estimates::last, Estimates::max, Estimates::min, POSTING_SOURCE, and type.
Referenced by ExternalPostList::ExternalPostList().
| Estimates EstimateOp::resolve | ( | Xapian::doccount | db_size, |
| Xapian::docid | db_first, | ||
| Xapian::docid | db_last | ||
| ) |
Definition at line 34 of file estimateop.cc.
References add_overflows(), AND, Assert, AssertEq, AssertRel, Estimates::est, Estimates::first, Estimates::last, Estimates::max, Estimates::min, NEAR, OR, sub_overflows(), usual, and XOR.
Referenced by LocalSubMatch::resolve().
|
private |
Definition at line 89 of file estimateop.h.
Referenced by EstimateOp(), report_first(), report_range_ratio(), report_ratio(), and report_termfreqs().
|
private |
Definition at line 91 of file estimateop.h.
Referenced by EstimateOp(), and get_subquery_count().
|
private |
Definition at line 77 of file estimateop.h.
Referenced by report_range_ratio(), report_ratio(), and report_termfreqs().