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

OmMSetIterator Class Reference

An iterator pointing to items in an MSet. More...

#include <omenquire.h>

List of all members.

Public Types

typedef std::input_iterator_tag iterator_category
typedef om_docid value_type
typedef om_doccount_diff difference_type
typedef om_docidpointer
typedef om_docidreference

Public Methods

 OmMSetIterator ()
 Create an uninitialised iterator; this cannot be used, but is convenient syntactically. More...

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

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

OmMSetIterator & operator++ ()
 Advance the iterator. More...

void operator++ (int)
om_docid operator * () const
 Get the document ID for the current position. More...

OmDocument get_document () const
 Get an OmDocument object for the current position. More...

om_doccount get_rank () const
 Get the rank of the document at the current position. More...

om_weight get_weight () const
 Get the weight of the document at the current position. More...

om_doccount get_collapse_count () const
 Get the number of documents that have been collapsed into this one. More...

om_percent get_percent () const
 This returns the weight of the document as a percentage score The return value will be in the range 0 to 100: 0 meaning that the item did not match the query at all. More...

std::string get_description () const
 Returns a string describing this object. More...


Public Attributes

Internal * internal

Friends

class OmMSet
bool operator== (const OmMSetIterator &a, const OmMSetIterator &b)


Detailed Description

An iterator pointing to items in an MSet.

This is used for access to individual results of a match.


Constructor & Destructor Documentation

OmMSetIterator::OmMSetIterator  
 

Create an uninitialised iterator; this cannot be used, but is convenient syntactically.

OmMSetIterator::OmMSetIterator const OmMSetIterator &    other
 

Copying is allowed (and is cheap).


Member Function Documentation

om_doccount OmMSetIterator::get_collapse_count   const
 

Get the number of documents that have been collapsed into this one.

If no documents have been collapsed, the result will be 0 NOTE: that this is a record on processing that occurred and not a predictive indicator on the type of results available.

It is entirely possible to get a collapse_count of zero when there exist other documents that might collapse, but were not found because the search terminated early with a full m-set.

It is entirely possible to get a non-zero collapse_count but find when repeating the search that none of the collapsed values proved relevant enough.

The collapse_count IS useful in at least this circumstance: It can be used to collapse multiple results of a similar type (share a common key) to avoid this type of result masking other types of results on account of the quanity of this document type. In such cases it is appropriate to offer an "expanded" search of the same search options but additionally filtering the results only to that type of document. So perhaps the top "Helpdesk" ticket would be shown along with other types of hit, but with this helpdesk hit will be a link to repeat the search over all helpdesk tickets only.

It must be stressed that this is just a technique to present one common document type from obscuring other rarer results without hiding the common results althogether.

std::string OmMSetIterator::get_description   const
 

Returns a string describing this object.

Introspection method.

OmDocument OmMSetIterator::get_document   const
 

Get an OmDocument object for the current position.

This method returns an OmDocument object which provides the information about the document pointed to by the MSetIterator.

If the underlying database has suitable support, using this call (rather than asking the database for a document based on its document ID) will enable the system to ensure that the correct data is returned, and that the document has not been deleted or changed since the query was performed.

Parameters:
it  The OmMSetIterator for which to retrieve the data.
Returns:
An OmDocument object containing the document data.
Exceptions:
OmDocNotFoundError  The document specified could not be found in the database.

om_percent OmMSetIterator::get_percent   const
 

This returns the weight of the document as a percentage score The return value will be in the range 0 to 100: 0 meaning that the item did not match the query at all.

om_doccount OmMSetIterator::get_rank   const
 

Get the rank of the document at the current position.

The rank is the position that this document is at in the ordered list of results of the query. The document judged "most relevant" will have rank of 0.

om_weight OmMSetIterator::get_weight   const
 

Get the weight of the document at the current position.

om_docid OmMSetIterator::operator *   const
 

Get the document ID for the current position.

OmMSetIterator& OmMSetIterator::operator++  
 

Advance the iterator.

void OmMSetIterator::operator= const OmMSetIterator &    other
 

Assignment is allowed (and is cheap).


The documentation for this class was generated from the following file:
Documentation for Xapian (version 0.6.4).
Generated on 10 Apr 2003 by Doxygen 1.2.15.