#include <enquire.h>

Classes | |
| class | Internal |
Public Types | |
| typedef MSetIterator | value_type |
| Allow use as an STL container. | |
| typedef MSetIterator | iterator |
| Allow use as an STL container. | |
| typedef MSetIterator | const_iterator |
| Allow use as an STL container. | |
| typedef MSetIterator & | reference |
| Allow use as an STL container. | |
| typedef MSetIterator & | const_reference |
| Allow use as an STL container. | |
| typedef MSetIterator * | pointer |
| Allow use as an STL container. | |
| typedef Xapian::doccount_diff | difference_type |
| Allow use as an STL container. | |
| typedef Xapian::doccount | size_type |
| Allow use as an STL container. | |
Public Member Functions | |
| MSet (MSet::Internal *internal_) | |
| MSet () | |
| Create an empty Xapian::MSet. | |
| ~MSet () | |
| Destroy a Xapian::MSet. | |
| MSet (const MSet &other) | |
| Copying is allowed (and is cheap). | |
| void | operator= (const MSet &other) |
| Assignment is allowed (and is cheap). | |
| void | fetch (const MSetIterator &begin, const MSetIterator &end) const |
| Fetch the document info for a set of items in the MSet. | |
| void | fetch (const MSetIterator &item) const |
| Fetch the single item specified. | |
| void | fetch () const |
| Fetch all the items in the MSet. | |
| Xapian::percent | convert_to_percent (Xapian::weight wt) const |
| This converts the weight supplied to a percentage score. | |
| Xapian::percent | convert_to_percent (const MSetIterator &it) const |
| Return the percentage score for a particular item. | |
| Xapian::doccount | get_termfreq (const std::string &tname) const |
| Return the term frequency of the given query term. | |
| Xapian::weight | get_termweight (const std::string &tname) const |
| Return the term weight of the given query term. | |
| Xapian::doccount | get_firstitem () const |
| The index of the first item in the result which was put into the MSet. | |
| Xapian::doccount | get_matches_lower_bound () const |
| A lower bound on the number of documents in the database which match the query. | |
| Xapian::doccount | get_matches_estimated () const |
| An estimate for the number of documents in the database which match the query. | |
| Xapian::doccount | get_matches_upper_bound () const |
| An upper bound on the number of documents in the database which match the query. | |
| Xapian::doccount | get_uncollapsed_matches_lower_bound () const |
| A lower bound on the number of documents in the database which would match the query if collapsing wasn't used. | |
| Xapian::doccount | get_uncollapsed_matches_estimated () const |
| A estimate of the number of documents in the database which would match the query if collapsing wasn't used. | |
| Xapian::doccount | get_uncollapsed_matches_upper_bound () const |
| A upper bound on the number of documents in the database which would match the query if collapsing wasn't used. | |
| Xapian::weight | get_max_possible () const |
| The maximum possible weight in the MSet. | |
| Xapian::weight | get_max_attained () const |
| The greatest weight which is attained by any document in the database. | |
| Xapian::doccount | size () const |
| The number of items in this MSet. | |
| Xapian::doccount | max_size () const |
| Required to allow use as an STL container. | |
| bool | empty () const |
| Test if this MSet is empty. | |
| void | swap (MSet &other) |
| Swap the MSet we point to with another. | |
| MSetIterator | begin () const |
| Iterator for the items in this MSet. | |
| MSetIterator | end () const |
| End iterator corresponding to begin(). | |
| MSetIterator | back () const |
| Iterator pointing to the last element of this MSet. | |
| MSetIterator | operator[] (Xapian::doccount i) const |
| This returns the document at position i in this MSet object. | |
| std::string | get_description () const |
| Return a string describing this object. | |
Public Attributes | |
| Xapian::Internal::RefCntPtr < Internal > | internal |
This class represents (a portion of) the results of a query.
Definition at line 52 of file enquire.h.
| typedef MSetIterator Xapian::MSet::iterator |
| typedef MSetIterator* Xapian::MSet::pointer |
| typedef MSetIterator& Xapian::MSet::reference |
| typedef MSetIterator Xapian::MSet::value_type |
| Xapian::MSet::MSet | ( | MSet::Internal * | internal_ | ) | [explicit] |
| Xapian::MSet::MSet | ( | ) |
| Xapian::MSet::~MSet | ( | ) |
| Xapian::MSet::MSet | ( | const MSet & | other | ) |
| MSetIterator Xapian::MSet::back | ( | ) | const |
Iterator pointing to the last element of this MSet.
Definition at line 353 of file omenquire.cc.
References Assert, empty(), and internal.
Referenced by DEFINE_TESTCASE().
| MSetIterator Xapian::MSet::begin | ( | ) | const |
Iterator for the items in this MSet.
Definition at line 332 of file omenquire.cc.
Referenced by DEFINE_TESTCASE(), main(), mset_expect_order_(), print_mset_percentages(), print_mset_weights(), serialise_mset(), and test_mset_order_equal().
| percent Xapian::MSet::convert_to_percent | ( | const MSetIterator & | it | ) | const |
Return the percentage score for a particular item.
Definition at line 211 of file omenquire.cc.
References Assert, Xapian::MSetIterator::get_weight(), internal, LOGCALL, and RETURN.
| percent Xapian::MSet::convert_to_percent | ( | Xapian::weight | wt | ) | const |
This converts the weight supplied to a percentage score.
The return value will be in the range 0 to 100, and will be 0 if and only if the item did not match the query at all.
| wt | The weight to convert. |
Definition at line 203 of file omenquire.cc.
References Assert, internal, LOGCALL, and RETURN.
Referenced by DEFINE_TESTCASE(), and print_mset_percentages().
| bool Xapian::MSet::empty | ( | ) | const |
Test if this MSet is empty.
Definition at line 319 of file omenquire.cc.
References Assert.
Referenced by back(), DEFINE_TESTCASE(), and operator==().
| MSetIterator Xapian::MSet::end | ( | ) | const |
End iterator corresponding to begin().
Definition at line 338 of file omenquire.cc.
References Assert, and internal.
Referenced by DEFINE_TESTCASE(), main(), print_mset_percentages(), print_mset_weights(), serialise_mset(), and test_mset_order_equal().
| void Xapian::MSet::fetch | ( | ) | const |
Fetch all the items in the MSet.
Definition at line 194 of file omenquire.cc.
References Assert, internal, and LOGCALL_VOID.
| void Xapian::MSet::fetch | ( | const MSetIterator & | item | ) | const |
Fetch the single item specified.
Definition at line 186 of file omenquire.cc.
References Assert, Xapian::MSetIterator::index, and LOGCALL_VOID.
| void Xapian::MSet::fetch | ( | const MSetIterator & | begin, | |
| const MSetIterator & | end | |||
| ) | const |
Fetch the document info for a set of items in the MSet.
This method causes the documents in the range specified by the iterators to be fetched from the database, and cached in the Xapian::MSet object. This has little effect when performing a search across a local database, but will greatly speed up subsequent access to the document contents when the documents are stored in a remote database.
The iterators must be over this Xapian::MSet - undefined behaviour will result otherwise.
| begin | MSetIterator for first item to fetch. | |
| end | MSetIterator for item after last item to fetch. |
Definition at line 177 of file omenquire.cc.
References Assert, Xapian::MSetIterator::index, and LOGCALL_VOID.
Referenced by DEFINE_TESTCASE().
| string Xapian::MSet::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 361 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE().
| Xapian::doccount Xapian::MSet::get_firstitem | ( | ) | const |
The index of the first item in the result which was put into the MSet.
This corresponds to the parameter "first" specified in Xapian::Enquire::get_mset(). A value of 0 corresponds to the highest result being the first item in the MSet.
Definition at line 249 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE(), and serialise_mset().
| Xapian::doccount Xapian::MSet::get_matches_estimated | ( | ) | const |
An estimate for the number of documents in the database which match the query.
This figure takes into account collapsing of duplicates, and weighting cutoff values.
This value is returned because there is sometimes a request to display such information. However, our experience is that presenting this value to users causes them to worry about the large number of results, rather than how useful those at the top of the result set are, and is thus undesirable.
Definition at line 263 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE(), main(), operator==(), PerfTestLogger::search_end(), and serialise_mset().
| Xapian::doccount Xapian::MSet::get_matches_lower_bound | ( | ) | const |
A lower bound on the number of documents in the database which match the query.
This figure takes into account collapsing of duplicates, and weighting cutoff values.
This number is usually considerably less than the actual number of documents which match the query.
Definition at line 256 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE(), operator==(), PerfTestLogger::search_end(), and serialise_mset().
| Xapian::doccount Xapian::MSet::get_matches_upper_bound | ( | ) | const |
An upper bound on the number of documents in the database which match the query.
This figure takes into account collapsing of duplicates, and weighting cutoff values.
This number is usually considerably greater than the actual number of documents which match the query.
Definition at line 270 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE(), operator==(), PerfTestLogger::search_end(), and serialise_mset().
| Xapian::weight Xapian::MSet::get_max_attained | ( | ) | const |
The greatest weight which is attained by any document in the database.
If firstitem == 0 and the primary ordering is by relevance, this is the weight of the first entry in the MSet.
If no documents are found by the query, this will be 0.
Note that calculation of max_attained requires calculation of at least one result item - therefore, if no items were requested when the query was performed (by specifying maxitems = 0 in Xapian::Enquire::get_mset()), this value will be 0.
Definition at line 305 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE(), and serialise_mset().
| Xapian::weight Xapian::MSet::get_max_possible | ( | ) | const |
The maximum possible weight in the MSet.
This weight is likely not to be attained in the set of results, but represents an upper bound on the weight which a document could attain for the given query.
Definition at line 298 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE(), operator==(), and serialise_mset().
| Xapian::doccount Xapian::MSet::get_termfreq | ( | const std::string & | tname | ) | const |
Return the term frequency of the given query term.
| tname | The term to look for. |
Definition at line 219 of file omenquire.cc.
References Assert, Xapian::Internal::RefCntPtr< T >::get(), internal, LOGCALL, and RETURN.
Referenced by DEFINE_TESTCASE().
| Xapian::weight Xapian::MSet::get_termweight | ( | const std::string & | tname | ) | const |
Return the term weight of the given query term.
| tname | The term to look for. |
| Xapian::InvalidArgumentError | is thrown if the term was not in the query. |
Definition at line 235 of file omenquire.cc.
References Assert, internal, LOGCALL, and RETURN.
Referenced by DEFINE_TESTCASE().
| Xapian::doccount Xapian::MSet::get_uncollapsed_matches_estimated | ( | ) | const |
A estimate of the number of documents in the database which would match the query if collapsing wasn't used.
Definition at line 284 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE(), and serialise_mset().
| Xapian::doccount Xapian::MSet::get_uncollapsed_matches_lower_bound | ( | ) | const |
A lower bound on the number of documents in the database which would match the query if collapsing wasn't used.
Definition at line 277 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE(), and serialise_mset().
| Xapian::doccount Xapian::MSet::get_uncollapsed_matches_upper_bound | ( | ) | const |
A upper bound on the number of documents in the database which would match the query if collapsing wasn't used.
Definition at line 291 of file omenquire.cc.
References Assert.
Referenced by DEFINE_TESTCASE(), and serialise_mset().
| Xapian::doccount Xapian::MSet::max_size | ( | ) | const [inline] |
| void Xapian::MSet::operator= | ( | const MSet & | other | ) |
Assignment is allowed (and is cheap).
Definition at line 171 of file omenquire.cc.
References internal.
| MSetIterator Xapian::MSet::operator[] | ( | Xapian::doccount | i | ) | const |
This returns the document at position i in this MSet object.
Note that this is not the same as the document at rank i in the query, unless the "first" parameter to Xapian::Enquire::get_mset was 0. Rather, it is the document at rank i + first.
In other words, the offset is into the documents represented by this object, not into the set of documents matching the query.
| i | The index into the MSet. |
Definition at line 345 of file omenquire.cc.
| Xapian::doccount Xapian::MSet::size | ( | ) | const |
The number of items in this MSet.
Definition at line 312 of file omenquire.cc.
References Assert.
Referenced by check_msets_contain_same_docs(), DEFINE_TESTCASE(), main(), mset_expect_order_(), mset_range_is_same(), mset_range_is_same_weights(), operator==(), operator[](), PerfTestLogger::search_end(), serialise_mset(), test_mset_order_equal(), and test_qp_value_range3().
| void Xapian::MSet::swap | ( | MSet & | other | ) |
Swap the MSet we point to with another.
Definition at line 326 of file omenquire.cc.
References internal.
Referenced by Xapian::MSet::Internal::Internal().
For internal use only.
Reference counted internals.
Definition at line 54 of file enquire.h.
Referenced by back(), convert_to_percent(), end(), fetch(), Xapian::MSetIterator::get_collapse_count(), Xapian::MSetIterator::get_collapse_key(), Xapian::MSetIterator::get_document(), MultiMatch::get_mset(), Xapian::MSetIterator::get_percent(), RemoteSubMatch::get_postlist_and_term_info(), get_termfreq(), get_termweight(), Xapian::MSetIterator::get_weight(), Xapian::MSetIterator::operator*(), operator=(), serialise_mset(), and swap().