Xapian::Document::Internal Class Reference

A document in the database, possibly plus modifications. More...

#include <document.h>

Inheritance diagram for Xapian::Document::Internal:

Inheritance graph
[legend]
Collaboration diagram for Xapian::Document::Internal:

Collaboration graph
[legend]
List of all members.

Public Types

typedef map< Xapian::valueno,
string > 
document_values
 Type to store values in.
typedef map< string, OmDocumentTermdocument_terms
 Type to store terms in.

Public Member Functions

string get_value (Xapian::valueno valueid) const
 Get value by value number.
Xapian::valueno values_count () const
void add_value (Xapian::valueno, const string &)
void remove_value (Xapian::valueno)
void clear_values ()
void add_posting (const string &, Xapian::termpos, Xapian::termcount)
void add_term (const string &, Xapian::termcount)
void remove_posting (const string &, Xapian::termpos, Xapian::termcount)
void remove_term (const string &)
void clear_terms ()
Xapian::termcount termlist_count () const
string get_data () const
 Get data stored in document.
void set_data (const string &)
TermListopen_term_list () const
 Open a term list.
void need_values () const
void need_terms () const
Xapian::docid get_docid () const
 Get the docid which is associated with this document (if any).
string get_description () const
 Return a string describing this object.
 Internal (const Xapian::Database::Internal *database_, Xapian::docid did_)
 Constructor.
 Internal ()
virtual ~Internal ()
 Destructor.

Protected Attributes

Xapian::docid did
 The document ID of the document in that database.

Private Member Functions

 Internal (const Internal &)
Internaloperator= (const Internal &)
virtual string do_get_value (Xapian::valueno) const
virtual map< Xapian::valueno,
string > 
do_get_all_values () const
virtual string do_get_data () const

Private Attributes

const Xapian::Database::Internaldatabase
 The database this document is in.
bool data_here
bool values_here
bool terms_here
string data
 The (user defined) data associated with this document.
document_values values
 The values associated with this document.
vector< Xapian::valuenovalue_nos
 The value numbers, for use by ValueIterators.
document_terms terms
 The terms (and their frequencies and positions) in this document.

Friends

class Xapian::ValueIterator

Detailed Description

A document in the database, possibly plus modifications.

Definition at line 37 of file document.h.


Member Typedef Documentation

typedef map<Xapian::valueno, string> Xapian::Document::Internal::document_values

Type to store values in.

Definition at line 41 of file document.h.

typedef map<string, OmDocumentTerm> Xapian::Document::Internal::document_terms

Type to store terms in.

Definition at line 44 of file document.h.


Constructor & Destructor Documentation

Xapian::Document::Internal::Internal ( const Internal  )  [private]

Xapian::Document::Internal::Internal ( const Xapian::Database::Internal database_,
Xapian::docid  did_ 
) [inline]

Constructor.

In derived classes, this will typically be a private method, and only be called by database objects of the corresponding type.

Definition at line 166 of file document.h.

Xapian::Document::Internal::Internal (  )  [inline]

Definition at line 170 of file document.h.

virtual Xapian::Document::Internal::~Internal (  )  [inline, virtual]

Destructor.

Note that the database object which created this document must still exist at the time this is called.

Definition at line 179 of file document.h.


Member Function Documentation

Internal& Xapian::Document::Internal::operator= ( const Internal  )  [private]

virtual string Xapian::Document::Internal::do_get_value ( Xapian::valueno   )  const [inline, private, virtual]

Reimplemented in FlintDocument, InMemoryDocument, QuartzDocument, and NetworkDocument.

Definition at line 80 of file document.h.

Referenced by get_value().

virtual map<Xapian::valueno, string> Xapian::Document::Internal::do_get_all_values (  )  const [inline, private, virtual]

Reimplemented in FlintDocument, InMemoryDocument, QuartzDocument, and NetworkDocument.

Definition at line 81 of file document.h.

Referenced by need_values().

virtual string Xapian::Document::Internal::do_get_data (  )  const [inline, private, virtual]

Reimplemented in FlintDocument, InMemoryDocument, QuartzDocument, and NetworkDocument.

Definition at line 85 of file document.h.

Referenced by get_data().

string Xapian::Document::Internal::get_value ( Xapian::valueno  valueid  )  const

Get value by value number.

Values are quickly accessible fields, for use during the match operation. Each document may have a set of values, each of which having a different valueid. Duplicate values with the same valueid are not supported in a single document.

Value numbers are any integer >= 0, but particular database backends may impose a more restrictive range than that.

Parameters:
valueid The value number requested.
Returns:
A string containing the specified value. If the value is not present in this document, the value's value will be a zero length string

Definition at line 262 of file omdocument.cc.

References database, do_get_value(), values, and values_here.

Xapian::valueno Xapian::Document::Internal::values_count (  )  const

Definition at line 435 of file omdocument.cc.

References Assert, DEBUGLINE, need_values(), values, and values_here.

void Xapian::Document::Internal::add_value ( Xapian::valueno  ,
const string &   
)

Definition at line 301 of file omdocument.cc.

References need_values(), value_nos, and values.

void Xapian::Document::Internal::remove_value ( Xapian::valueno   ) 

Definition at line 309 of file omdocument.cc.

References need_values(), om_tostring(), value_nos, and values.

void Xapian::Document::Internal::clear_values (  ) 

Definition at line 323 of file omdocument.cc.

References value_nos, values, and values_here.

void Xapian::Document::Internal::add_posting ( const string &  ,
Xapian::termpos  ,
Xapian::termcount   
)

Definition at line 331 of file omdocument.cc.

References need_terms(), and terms.

void Xapian::Document::Internal::add_term ( const string &  ,
Xapian::termcount   
)

Definition at line 349 of file omdocument.cc.

References need_terms(), and terms.

void Xapian::Document::Internal::remove_posting ( const string &  ,
Xapian::termpos  ,
Xapian::termcount   
)

Definition at line 364 of file omdocument.cc.

References need_terms(), and terms.

void Xapian::Document::Internal::remove_term ( const string &   ) 

Definition at line 382 of file omdocument.cc.

References need_terms(), and terms.

void Xapian::Document::Internal::clear_terms (  ) 

Definition at line 396 of file omdocument.cc.

References terms, and terms_here.

Xapian::termcount Xapian::Document::Internal::termlist_count (  )  const

Definition at line 403 of file omdocument.cc.

References Assert, need_terms(), terms, and terms_here.

string Xapian::Document::Internal::get_data (  )  const

Get data stored in document.

This is a general piece of data associated with a document, and will typically be used to store such information as text to be displayed in the result list, and a pointer in some form (eg, URL) to the full text of the document.

This operation can be expensive, and shouldn't normally be used during the match operation (such as in a match decider functor): use a value instead, if at all possible.

Returns:
An string containing the data for this document.

Definition at line 275 of file omdocument.cc.

References data_here, database, and do_get_data().

void Xapian::Document::Internal::set_data ( const string &   ) 

Definition at line 283 of file omdocument.cc.

References data_here.

TermList * Xapian::Document::Internal::open_term_list (  )  const

Open a term list.

This is a list of all the terms contained by a given document.

Returns:
A pointer to the newly created term list. This object must be deleted by the caller after use.

Definition at line 290 of file omdocument.cc.

References database, DEBUGCALL, did, open_term_list(), RETURN, terms, and terms_here.

Referenced by need_terms(), and open_term_list().

void Xapian::Document::Internal::need_values (  )  const

Definition at line 472 of file omdocument.cc.

References database, do_get_all_values(), value_nos, values, and values_here.

Referenced by add_value(), remove_value(), and values_count().

void Xapian::Document::Internal::need_terms (  )  const

Definition at line 415 of file omdocument.cc.

References database, did, open_term_list(), terms, and terms_here.

Referenced by add_posting(), add_term(), remove_posting(), remove_term(), and termlist_count().

Xapian::docid Xapian::Document::Internal::get_docid (  )  const [inline]

Get the docid which is associated with this document (if any).

NB If multiple databases are being searched together, then this will be the document id in the individual database, not the merged database!

Returns:
If this document came from a database, return the document id in that database. Otherwise, return 0.

Definition at line 156 of file document.h.

References did.

string Xapian::Document::Internal::get_description (  )  const

Return a string describing this object.

Definition at line 444 of file omdocument.cc.

References data_here, database, om_tostring(), terms, terms_here, values, and values_here.


Friends And Related Function Documentation

friend class Xapian::ValueIterator [friend]

Definition at line 38 of file document.h.


Member Data Documentation

const Xapian::Database::Internal* Xapian::Document::Internal::database [private]

The database this document is in.

Reimplemented in FlintDocument, and QuartzDocument.

Definition at line 52 of file document.h.

Referenced by get_data(), get_description(), get_value(), need_terms(), need_values(), and open_term_list().

bool Xapian::Document::Internal::data_here [private]

Definition at line 54 of file document.h.

Referenced by get_data(), get_description(), and set_data().

bool Xapian::Document::Internal::values_here [mutable, private]

Definition at line 55 of file document.h.

Referenced by clear_values(), get_description(), get_value(), need_values(), and values_count().

bool Xapian::Document::Internal::terms_here [mutable, private]

Definition at line 56 of file document.h.

Referenced by clear_terms(), get_description(), need_terms(), open_term_list(), and termlist_count().

string Xapian::Document::Internal::data [private]

The (user defined) data associated with this document.

Definition at line 59 of file document.h.

document_values Xapian::Document::Internal::values [mutable, private]

The values associated with this document.

Reimplemented in InMemoryDocument, and NetworkDocument.

Definition at line 62 of file document.h.

Referenced by add_value(), clear_values(), get_description(), get_value(), need_values(), remove_value(), and values_count().

vector<Xapian::valueno> Xapian::Document::Internal::value_nos [mutable, private]

The value numbers, for use by ValueIterators.

Definition at line 65 of file document.h.

Referenced by add_value(), clear_values(), need_values(), and remove_value().

document_terms Xapian::Document::Internal::terms [mutable, private]

The terms (and their frequencies and positions) in this document.

Definition at line 68 of file document.h.

Referenced by add_posting(), add_term(), clear_terms(), get_description(), need_terms(), open_term_list(), remove_posting(), remove_term(), and termlist_count().

Xapian::docid Xapian::Document::Internal::did [protected]

The document ID of the document in that database.

If we're using multiple databases together this may not be the same as the docid in the combined database.

Definition at line 76 of file document.h.

Referenced by QuartzDocument::do_get_all_values(), FlintDocument::do_get_all_values(), QuartzDocument::do_get_data(), FlintDocument::do_get_data(), QuartzDocument::do_get_value(), FlintDocument::do_get_value(), FlintDocument::FlintDocument(), get_docid(), need_terms(), open_term_list(), and QuartzDocument::QuartzDocument().


The documentation for this class was generated from the following files:
Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.