Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

OmMSet Class Reference

A match set (MSet). More...

#include <omenquire.h>

List of all members.

Public Types

typedef std::input_iterator_tag iterator_category
typedef OmMSetIterator value_type
typedef OmMSetIterator iterator
typedef OmMSetIterator const_iterator
typedef OmMSetIteratorreference
typedef OmMSetIteratorconst_reference
typedef OmMSetIteratorpointer
typedef om_doccount_diff difference_type
typedef om_doccount size_type

Public Methods

 OmMSet (OmMSet::Internal *internal_)
 OmMSet ()
 Create an empty OmMSet. More...

 ~OmMSet ()
 Destroy an OmMSet. More...

 OmMSet (const OmMSet &other)
 Copying is allowed (and is cheap). More...

void operator= (const OmMSet &other)
 Assignment is allowed (and is cheap). More...

void fetch (const OmMSetIterator &begin, const OmMSetIterator &end) const
 Fetch the the document info for a set of items in the MSet. More...

void fetch (const OmMSetIterator &item) const
 Fetch the single item specified. More...

void fetch () const
 Fetch all the items in the MSet. More...

om_percent convert_to_percent (om_weight wt) const
 This converts the weight supplied to a percentage score. More...

om_percent convert_to_percent (const OmMSetIterator &it) const
 Return the percentage score for a particular item. More...

om_doccount get_termfreq (const om_termname &tname) const
 Return the term frequency of the given query term. More...

om_weight get_termweight (const om_termname &tname) const
 Return the term weight of the given query term. More...

om_doccount get_firstitem () const
 The index of the first item in the result which was put into the mset. More...

om_doccount get_matches_lower_bound () const
 A lower bound on the number of documents in the database which have a weight greater than zero. More...

om_doccount get_matches_estimated () const
 An estimate for the number of documents in the database which have a weight greater than zero. More...

om_doccount get_matches_upper_bound () const
 An upper bound on the number of documents in the database with a weight greater than zero. More...

om_weight get_max_possible () const
 The maximum possible weight in the mset. More...

om_weight get_max_attained () const
 The greatest weight which is attained by any document in the database. More...

om_doccount size () const
om_doccount max_size () const
bool empty () const
void swap (OmMSet &other)
OmMSetIterator begin () const
OmMSetIterator end () const
OmMSetIterator back () const
OmMSetIterator operator[] (om_doccount i) const
 This returns the document at position i in this MSet object. More...

std::string get_description () const
 Returns a string representing the mset. More...


Public Attributes

Internal * internal


Detailed Description

A match set (MSet).

This class represents (a portion of) the results of a query.


Constructor & Destructor Documentation

OmMSet::OmMSet  
 

Create an empty OmMSet.

OmMSet::~OmMSet  
 

Destroy an OmMSet.

OmMSet::OmMSet const OmMSet &    other
 

Copying is allowed (and is cheap).


Member Function Documentation

om_percent OmMSet::convert_to_percent const OmMSetIterator   it const
 

Return the percentage score for a particular item.

om_percent OmMSet::convert_to_percent om_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.

void OmMSet::fetch   const
 

Fetch all the items in the MSet.

void OmMSet::fetch const OmMSetIterator   item const
 

Fetch the single item specified.

void OmMSet::fetch const OmMSetIterator   begin,
const OmMSetIterator   end
const
 

Fetch the 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 OmMSet 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 OmMSet: undefined behaviour will result otherwise.

Parameters:
begin  OmMSetIterator for first item to fetch.
end  OmMSetIterator for item after last item to fetch.

std::string OmMSet::get_description   const
 

Returns a string representing the mset.

Introspection method.

om_doccount OmMSet::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 OmEnquire::get_mset(). A value of 0 corresponds to the highest result being the first item in the mset.

om_doccount OmMSet::get_matches_estimated   const
 

An estimate for the number of documents in the database which have a weight greater than zero.

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.

om_doccount OmMSet::get_matches_lower_bound   const
 

A lower bound on the number of documents in the database which have a weight greater than zero.

This number is usually considerably less than the actual number of documents which match the query.

om_doccount OmMSet::get_matches_upper_bound   const
 

An upper bound on the number of documents in the database with a weight greater than zero.

This number is usually considerably greater than the actual number of documents which match the query.

om_weight OmMSet::get_max_attained   const
 

The greatest weight which is attained by any document in the database.

If firstitem == 0, this is the weight of the first entry in items.

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 OmEnquire::get_mset()), this value will be 0.

om_weight OmMSet::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.

om_doccount OmMSet::get_termfreq const om_termname &    tname const
 

Return the term frequency of the given query term.

Parameters:
tname  The term to look for.
Exceptions:
OmInvalidArgumentError  is thrown if the term was not in the query.

om_weight OmMSet::get_termweight const om_termname &    tname const
 

Return the term weight of the given query term.

Parameters:
tname  The term to look for.
Exceptions:
OmInvalidArgumentError  is thrown if the term was not in the query.

void OmMSet::operator= const OmMSet &    other
 

Assignment is allowed (and is cheap).

OmMSetIterator OmMSet::operator[] om_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 OmEnquire::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.


The documentation for this class was generated from the following file:
Documentation for Xapian (version 0.5.2).
Generated on 12 Oct 2002 by Doxygen 1.2.15.