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

OmDocument Class Reference

A document in the database - holds data, values, terms, and postings. More...

#include <omdocument.h>

List of all members.

Public Methods

 OmDocument (OmDocument::Internal *internal_)
 OmDocument (const OmDocument &other)
 Copying is allowed. More...

void operator= (const OmDocument &other)
 Assignment is allowed. More...

 OmDocument ()
 Make a new empty OmDocument. More...

 ~OmDocument ()
 Destructor. More...

std::string get_value (om_valueno value) const
 Get value by number (>= 0). More...

void add_value (om_valueno valueno, const std::string &value)
 Add a new value. It will replace any existing value with the. More...

void remove_value (om_valueno valueno)
 Remove any value with the given number. More...

void clear_values ()
 Remove all values associated with the document. More...

std::string get_data () const
 Get data stored in the document. More...

void set_data (const std::string &data)
 Set data stored in the document. More...

void add_posting (const om_termname &tname, om_termpos tpos, om_termcount wdfinc=1)
 Add an occurrence of a term at a particular position. More...

void add_term_nopos (const om_termname &tname, om_termcount wdfinc=1)
 Add a term to the document, without specifying a position that it occurs at. More...

void remove_posting (const om_termname &tname, om_termpos tpos, om_termcount wdfdec=1)
 Remove a posting of a term from the document. More...

void remove_term (const om_termname &tname)
 Remove a term and all postings associated with it. More...

void clear_terms ()
 Remove all terms (and postings) from the document. More...

om_termcount termlist_count ()
 Count the terms in this document. More...

OmTermIterator termlist_begin () const
 Iterator for the terms in this document. More...

OmTermIterator termlist_end () const
 Equivalent end iterator for termlist_begin(). More...

om_termcount values_count ()
 Count the values in this document. More...

OmValueIterator values_begin () const
 Iterator for the values in this document. More...

OmValueIterator values_end () const
 Equivalent end iterator for values_begin(). More...

std::string get_description () const
 Introspection method. More...


Public Attributes

Internal * internal


Detailed Description

A document in the database - holds data, values, terms, and postings.


Constructor & Destructor Documentation

OmDocument::OmDocument const OmDocument &    other
 

Copying is allowed.

The internals are reference counted, so copying is cheap.

OmDocument::OmDocument  
 

Make a new empty OmDocument.

OmDocument::~OmDocument  
 

Destructor.


Member Function Documentation

void OmDocument::add_posting const om_termname &    tname,
om_termpos    tpos,
om_termcount    wdfinc = 1
 

Add an occurrence of a term at a particular position.

Multiple occurrences of the term at the same position are represented only once in the positional information, but do increase the wdf.

If the term is not already in the document, it will be added to it.

Parameters:
tname  The name of the term.
tpos  The position of the term.
wdfinc  The increment that will be applied to the wdf for this term.

void OmDocument::add_term_nopos const om_termname &    tname,
om_termcount    wdfinc = 1
 

Add a term to the document, without specifying a position that it occurs at.

Any existing positional information for the term will be left unmodified.

Parameters:
tname  The name of the term.
wdfinc  The increment that will be applied to the wdf for this term.

void OmDocument::add_value om_valueno    valueno,
const std::string &    value
 

Add a new value. It will replace any existing value with the.

void OmDocument::clear_terms  
 

Remove all terms (and postings) from the document.

void OmDocument::clear_values  
 

Remove all values associated with the document.

std::string OmDocument::get_data   const
 

Get data stored in the document.

This is a potentially expensive operation, and shouldn't normally be used in a match decider functor. Put data for use by match deciders in a value instead.

std::string OmDocument::get_description   const
 

Introspection method.

Returns:
A string representing this OmDocument.

std::string OmDocument::get_value om_valueno    value const
 

Get value by number (>= 0).

void OmDocument::operator= const OmDocument &    other
 

Assignment is allowed.

The internals are reference counted, so assignment is cheap.

void OmDocument::remove_posting const om_termname &    tname,
om_termpos    tpos,
om_termcount    wdfdec = 1
 

Remove a posting of a term from the document.

Note that the term will still index the document even if all occurrences are removed. To remove a term from a document completely, use remove_term().

Parameters:
tname  The name of the term.
tpos  The position of the term.
wdfdec  The decrement that will be applied to the wdf when removing this posting. The wdf will not go below the value of 0.
Exceptions:
OmInvalidArgumentError  will be thrown if the term is not at the position specified in the position list for this term in this document.
OmInvalidArgumentError  will be thrown if the term is not in the document

void OmDocument::remove_term const om_termname &    tname
 

Remove a term and all postings associated with it.

Parameters:
tname  The name of the term.
Exceptions:
OmInvalidArgumentError  will be thrown if the term is not in the document

void OmDocument::remove_value om_valueno    valueno
 

Remove any value with the given number.

void OmDocument::set_data const std::string &    data
 

Set data stored in the document.

OmTermIterator OmDocument::termlist_begin   const
 

Iterator for the terms in this document.

om_termcount OmDocument::termlist_count  
 

Count the terms in this document.

OmTermIterator OmDocument::termlist_end   const
 

Equivalent end iterator for termlist_begin().

OmValueIterator OmDocument::values_begin   const
 

Iterator for the values in this document.

om_termcount OmDocument::values_count  
 

Count the values in this document.

OmValueIterator OmDocument::values_end   const
 

Equivalent end iterator for values_begin().


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