|
xapian-core
2.0.0
|
#include <matcher.h>
Collaboration diagram for Matcher:Public Member Functions | |
| Matcher (const Xapian::Database &db_, const Xapian::Query &query, Xapian::termcount query_length, const Xapian::RSet *rset, Xapian::Weight::Internal &stats, const Xapian::Weight &wtscheme, bool have_mdecider, Xapian::valueno collapse_key, Xapian::doccount collapse_max, int percent_threshold, double weight_threshold, Xapian::Enquire::docid_order order, Xapian::valueno sort_key, Xapian::Enquire::Internal::sort_setting sort_by, bool sort_val_reverse, double time_limit, const std::vector< opt_ptr_spy > &matchspies) | |
| Constructor. More... | |
| Xapian::MSet | get_mset (Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount check_at_least, Xapian::Weight::Internal &stats, const Xapian::Weight &wtscheme, const Xapian::MatchDecider *mdecider, const Xapian::KeyMaker *sorter, Xapian::valueno collapse_key, Xapian::doccount collapse_max, int percent_threshold, double weight_threshold, Xapian::Enquire::docid_order order, Xapian::valueno sort_key, Xapian::Enquire::Internal::sort_setting sort_by, bool sort_val_reverse, double time_limit, const std::vector< opt_ptr_spy > &matchspies) |
| Run the match and produce an MSet object. More... | |
Private Types | |
| typedef Xapian::Internal::opt_intrusive_ptr< Xapian::MatchSpy > | opt_ptr_spy |
Private Member Functions | |
| Matcher (const Matcher &)=delete | |
| Matcher & | operator= (const Matcher &)=delete |
| Xapian::MSet | get_local_mset (Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount check_at_least, const Xapian::Weight &wtscheme, const Xapian::MatchDecider *mdecider, const Xapian::KeyMaker *sorter, Xapian::valueno collapse_key, Xapian::doccount collapse_max, int percent_threshold, double percent_threshold_factor, double weight_threshold, Xapian::Enquire::docid_order order, Xapian::valueno sort_key, Xapian::Enquire::Internal::sort_setting sort_by, bool sort_val_reverse, double time_limit, const std::vector< opt_ptr_spy > &matchspies) |
| template<typename Action > | |
| void | for_all_remotes (Action action) |
| Perform action on remotes as they become ready using poll() or select(). More... | |
Private Attributes | |
| Xapian::Database | db |
| std::vector< std::unique_ptr< LocalSubMatch > > | locals |
| LocalSubMatch objects for local databases. More... | |
| std::vector< std::unique_ptr< RemoteSubMatch > > | remotes |
| RemoteSubMatch objects for remote databases. More... | |
| std::size_t | first_nonselectable |
| Partition point in remotes. More... | |
|
private |
|
privatedelete |
| Matcher::Matcher | ( | const Xapian::Database & | db_, |
| const Xapian::Query & | query, | ||
| Xapian::termcount | query_length, | ||
| const Xapian::RSet * | rset, | ||
| Xapian::Weight::Internal & | stats, | ||
| const Xapian::Weight & | wtscheme, | ||
| bool | have_mdecider, | ||
| Xapian::valueno | collapse_key, | ||
| Xapian::doccount | collapse_max, | ||
| int | percent_threshold, | ||
| double | weight_threshold, | ||
| Xapian::Enquire::docid_order | order, | ||
| Xapian::valueno | sort_key, | ||
| Xapian::Enquire::Internal::sort_setting | sort_by, | ||
| bool | sort_val_reverse, | ||
| double | time_limit, | ||
| const std::vector< opt_ptr_spy > & | matchspies | ||
| ) |
Constructor.
| db_ | Database to search |
| query | Query object |
| query_length | Query length |
| rset | Relevance set (NULL for none) |
| stats | Object to collate stats into |
| wtscheme | Weight object to use as factory |
| have_mdecider | MatchDecider specified? |
| collapse_key | value slot to collapse on (Xapian::BAD_VALUENO which means no collapsing) |
| collapse_max | Maximum number of documents with the same key to allow |
| percent_threshold | Lower bound on percentage score |
| weight_threshold | Lower bound on weight |
| order | Xapian::docid sort order |
| sort_key | Value slot to sort on |
| sort_by | What to sort results on |
| sort_val_reverse | Reverse direction keys sort in? |
| time_limit | time in seconds after which to disable check_at_least (0.0 means don't). |
| matchspies | MatchSpy objects to use |
|
inlineprivate |
Perform action on remotes as they become ready using poll() or select().
Definition at line 80 of file matcher.cc.
References socket_errno().
Referenced by get_mset().
|
private |
EstimateOp tree to calculate an Estimates object for each local shard.
This allows the estimate to be calculated at the end of the match so that it can incorporate information about things such as how many documents were accepted and rejected by positional checks.
Definition at line 341 of file matcher.cc.
References Xapian::Internal::intrusive_base::_refs, Assert, db, EstimateOp::DECIDER, PostListTree::delete_postlists(), Xapian::Enquire::DESCENDING, DOCID, dummy, ProtoMSet::early_reject(), Estimates::est, Xapian::Internal::PostListAndEstimate::est, ProtoMSet::finalise(), PostListTree::get_docid(), ProtoMSet::get_min_weight(), get_msetcmp_function(), ValueStreamDocument::get_value(), PostListTree::get_weight(), locals, Estimates::max, Estimates::min, PostListTree::next(), Xapian::Internal::PostListAndEstimate::pl, ProtoMSet::process(), Xapian::Vec< T, COW, UNIQUEPTR, typename >::push_back(), PostListTree::recalc_maxweight(), REL, REL_VAL, ValueStreamDocument::set_document(), ProtoMSet::set_new_min_weight(), PostListTree::set_postlists(), Result::set_sort_key(), Result::set_weight(), Xapian::Vec< T, COW, UNIQUEPTR, typename >::size(), VAL, and VAL_REL.
Referenced by get_mset().
| Xapian::MSet Matcher::get_mset | ( | Xapian::doccount | first, |
| Xapian::doccount | maxitems, | ||
| Xapian::doccount | check_at_least, | ||
| Xapian::Weight::Internal & | stats, | ||
| const Xapian::Weight & | wtscheme, | ||
| const Xapian::MatchDecider * | mdecider, | ||
| const Xapian::KeyMaker * | sorter, | ||
| Xapian::valueno | collapse_key, | ||
| Xapian::doccount | collapse_max, | ||
| int | percent_threshold, | ||
| double | weight_threshold, | ||
| Xapian::Enquire::docid_order | order, | ||
| Xapian::valueno | sort_key, | ||
| Xapian::Enquire::Internal::sort_setting | sort_by, | ||
| bool | sort_val_reverse, | ||
| double | time_limit, | ||
| const std::vector< opt_ptr_spy > & | matchspies | ||
| ) |
Run the match and produce an MSet object.
| first | Zero-based index of the first result to return (which supports retrieving pages of results). |
| maxitems | The maximum number of documents to return. |
| checkatleast | Check at least this many documents. By default Xapian will avoiding considering documents which it can prove can't match, which is faster but can result in a loose bounds on and a poor estimate of the total number of matches - setting checkatleast higher allows trading off speed for tighter bounds and a more accurate estimate. |
| mset | MSet object to full in |
| stats | Collated stats |
| wtscheme | Weight object to use as factory |
| mdecider | MatchDecider to use (NULL for none) |
| sorter | KeyMaker for sort keys (NULL for none) |
| collapse_key | value slot to collapse on (Xapian::BAD_VALUENO which means no collapsing) |
| collapse_max | Maximum number of documents with the same key to allow |
| collapse_key | value slot to collapse on (Xapian::BAD_VALUENO which means no collapsing) |
| collapse_max | Maximum number of documents with the same key to allow |
| percent_threshold | Lower bound on percentage score |
| weight_threshold | Lower bound on weight |
| order | Xapian::docid sort order |
| sort_key | Value slot to sort on |
| sort_by | What to sort results on |
| sort_val_reverse | Reverse direction keys sort in? |
| time_limit | time in seconds after which to disable check_at_least (0.0 means don't). |
| matchspies | MatchSpy objects to use |
Definition at line 577 of file matcher.cc.
References Assert, AssertRel, db, Xapian::MSet::empty(), for_all_remotes(), Xapian::Internal::intrusive_ptr_nonnull< T >::get(), get_local_mset(), RemoteSubMatch::get_mset(), RemoteSubMatch::get_shard(), if(), Xapian::Database::internal, Xapian::MSet::internal, locals, remotes, and RemoteSubMatch::start_match().
Referenced by Xapian::Enquire::Internal::get_mset(), and RemoteServer::msg_query().
|
private |
Definition at line 49 of file matcher.h.
Referenced by get_local_mset(), and get_mset().
|
private |
|
private |
LocalSubMatch objects for local databases.
The entries are at the same index as the corresponding shard in the Database object, with NULL entries for any remote shards.
Definition at line 56 of file matcher.h.
Referenced by get_local_mset(), and get_mset().
|
private |
RemoteSubMatch objects for remote databases.
Unlike locals, this only contains entries for remote shards, and each RemoteSubMatch object knows its shard index.
If poll() isn't available then select() has to be used to wait for fds to become ready to read, which imposes some limitations:
To work within these limitations, we order the objects in the vector so the ones we can select() on all come before the ones we can't select() on.
The partition point is recorded in first_nonselectable.
Definition at line 78 of file matcher.h.
Referenced by get_mset().