#include <document.h>


Public Types | |
| typedef map< Xapian::valueno, string > | document_values |
| Type to store values in. | |
| typedef map< string, OmDocumentTerm > | document_terms |
| Type to store terms in. | |
Public Member Functions | |
| string | get_value (Xapian::valueno slot) const |
| Get value by value number. | |
| void | set_all_values (map< Xapian::valueno, string > &values_) |
| Set all the values. | |
| 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 &) |
| TermList * | open_term_list () const |
| Open a term list. | |
| void | need_values () const |
| void | need_terms () const |
| bool | data_modified () const |
| Return true if the data in the document may have been modified. | |
| bool | values_modified () const |
| Return true if the values in the document may have been modified. | |
| bool | terms_modified () const |
| Return true if the terms in the document may have been modified. | |
| bool | term_positions_modified () const |
| Return true if term positions may have been modified. | |
| bool | modified () const |
| Return true if the document may have been modified. | |
| 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 (Xapian::Internal::RefCntPtr< const Xapian::Database::Internal > database_, Xapian::docid did_) | |
| Constructor. | |
| Internal () | |
| virtual | ~Internal () |
| Destructor. | |
Protected Attributes | |
| Xapian::Internal::RefCntPtr < const Xapian::Database::Internal > | database |
| The database this document is in. | |
| Xapian::docid | did |
| The document ID of the document in that database. | |
Private Member Functions | |
| Internal (const Internal &) | |
| Internal & | operator= (const Internal &) |
| virtual string | do_get_value (Xapian::valueno) const |
| virtual void | do_get_all_values (map< Xapian::valueno, string > &values_) const |
| virtual string | do_get_data () const |
Private Attributes | |
| bool | data_here |
| bool | values_here |
| bool | terms_here |
| bool | positions_modified |
| string | data |
| The (user defined) data associated with this document. | |
| document_values | values |
| The values associated with this document. | |
| document_terms | terms |
| The terms (and their frequencies and positions) in this document. | |
Friends | |
| class | ::DocumentValueList |
| class | ::ValueStreamDocument |
Definition at line 40 of file document.h.
| typedef map<string, OmDocumentTerm> Xapian::Document::Internal::document_terms |
| typedef map<Xapian::valueno, string> Xapian::Document::Internal::document_values |
| Xapian::Document::Internal::Internal | ( | const Internal & | ) | [private] |
| Xapian::Document::Internal::Internal | ( | Xapian::Internal::RefCntPtr< 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 207 of file document.h.
| Xapian::Document::Internal::Internal | ( | ) | [inline] |
Definition at line 212 of file document.h.
| Xapian::Document::Internal::~Internal | ( | ) | [virtual] |
Destructor.
Note that the database object which created this document must still exist at the time this is called.
Definition at line 503 of file omdocument.cc.
References database, and Xapian::Internal::RefCntPtr< T >::get().
| void Xapian::Document::Internal::add_posting | ( | const string & | tname, | |
| Xapian::termpos | tpos, | |||
| Xapian::termcount | wdfinc | |||
| ) |
Definition at line 345 of file omdocument.cc.
References OmDocumentTerm::add_position(), need_terms(), positions_modified, and terms.
| void Xapian::Document::Internal::add_term | ( | const string & | tname, | |
| Xapian::termcount | wdfinc | |||
| ) |
| void Xapian::Document::Internal::add_value | ( | Xapian::valueno | slot, | |
| const string & | value | |||
| ) |
| void Xapian::Document::Internal::clear_terms | ( | ) |
| void Xapian::Document::Internal::clear_values | ( | ) |
| bool Xapian::Document::Internal::data_modified | ( | ) | const [inline] |
Return true if the data in the document may have been modified.
Definition at line 162 of file document.h.
References data_here.
| virtual void Xapian::Document::Internal::do_get_all_values | ( | map< Xapian::valueno, string > & | values_ | ) | const [inline, private, virtual] |
Reimplemented in BrassDocument, and ChertDocument.
Definition at line 84 of file document.h.
Referenced by need_values().
| virtual string Xapian::Document::Internal::do_get_data | ( | ) | const [inline, private, virtual] |
Reimplemented in BrassDocument, ChertDocument, FlintDocument, InMemoryDocument, RemoteDocument, and ValueStreamDocument.
Definition at line 87 of file document.h.
Referenced by ValueStreamDocument::do_get_data(), and get_data().
| virtual string Xapian::Document::Internal::do_get_value | ( | Xapian::valueno | ) | const [inline, private, virtual] |
Reimplemented in BrassDocument, ChertDocument, FlintDocument, InMemoryDocument, RemoteDocument, and ValueStreamDocument.
Definition at line 83 of file document.h.
Referenced by get_value().
| 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.
Definition at line 286 of file omdocument.cc.
References data, data_here, database, do_get_data(), and Xapian::Internal::RefCntPtr< T >::get().
| string Xapian::Document::Internal::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 464 of file omdocument.cc.
References data, data_here, database, Xapian::Internal::RefCntPtr< T >::get(), Xapian::Internal::str(), terms, terms_here, values, and values_here.
| 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!
Definition at line 197 of file document.h.
References did.
| string Xapian::Document::Internal::get_value | ( | Xapian::valueno | slot | ) | 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 value number. Duplicate values with the same value number 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.
| slot | The value number requested. |
Reimplemented in ValueStreamDocument.
Definition at line 273 of file omdocument.cc.
References database, do_get_value(), Xapian::Internal::RefCntPtr< T >::get(), values, and values_here.
Referenced by ValueStreamDocument::do_get_value(), and Collapser::process().
| bool Xapian::Document::Internal::modified | ( | ) | const [inline] |
Return true if the document may have been modified.
Definition at line 184 of file document.h.
References data_here, terms_here, and values_here.
| void Xapian::Document::Internal::need_terms | ( | ) | const |
Definition at line 435 of file omdocument.cc.
References database, did, Xapian::Internal::RefCntPtr< T >::get(), terms, and terms_here.
Referenced by add_posting(), add_term(), remove_posting(), remove_term(), and termlist_count().
| void Xapian::Document::Internal::need_values | ( | ) | const |
Definition at line 492 of file omdocument.cc.
References Assert, database, do_get_all_values(), Xapian::Internal::RefCntPtr< T >::get(), values, and values_here.
Referenced by add_value(), remove_value(), and values_count().
| 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.
Definition at line 301 of file omdocument.cc.
References database, did, Xapian::Internal::RefCntPtr< T >::get(), LOGCALL, RETURN, terms, and terms_here.
| void Xapian::Document::Internal::remove_posting | ( | const string & | tname, | |
| Xapian::termpos | tpos, | |||
| Xapian::termcount | wdfdec | |||
| ) |
Definition at line 379 of file omdocument.cc.
References need_terms(), positions_modified, and terms.
| void Xapian::Document::Internal::remove_term | ( | const string & | tname | ) |
Definition at line 398 of file omdocument.cc.
References need_terms(), positions_modified, and terms.
| void Xapian::Document::Internal::remove_value | ( | Xapian::valueno | slot | ) |
Definition at line 325 of file omdocument.cc.
References need_values(), Xapian::Internal::str(), and values.
| void Xapian::Document::Internal::set_all_values | ( | map< Xapian::valueno, string > & | values_ | ) | [inline] |
Set all the values.
| values_ | The values to set - passed by non-const reference, and may be modified by the call. |
Definition at line 113 of file document.h.
References values, and values_here.
Referenced by RemoteDocument::RemoteDocument().
| void Xapian::Document::Internal::set_data | ( | const string & | data_ | ) |
Definition at line 294 of file omdocument.cc.
References data, and data_here.
Referenced by RemoteDocument::RemoteDocument().
| bool Xapian::Document::Internal::term_positions_modified | ( | ) | const [inline] |
Return true if term positions may have been modified.
Definition at line 179 of file document.h.
References positions_modified.
| Xapian::termcount Xapian::Document::Internal::termlist_count | ( | ) | const |
Definition at line 423 of file omdocument.cc.
References Assert, need_terms(), terms, and terms_here.
| bool Xapian::Document::Internal::terms_modified | ( | ) | const [inline] |
Return true if the terms in the document may have been modified.
Definition at line 174 of file document.h.
References terms_here.
| Xapian::valueno Xapian::Document::Internal::values_count | ( | ) | const |
Definition at line 455 of file omdocument.cc.
References Assert, LOGCALL, need_values(), RETURN, values, and values_here.
| bool Xapian::Document::Internal::values_modified | ( | ) | const [inline] |
Return true if the values in the document may have been modified.
Definition at line 168 of file document.h.
References values_here.
friend class ::DocumentValueList [friend] |
Definition at line 41 of file document.h.
friend class ::ValueStreamDocument [friend] |
Definition at line 42 of file document.h.
string Xapian::Document::Internal::data [private] |
The (user defined) data associated with this document.
Definition at line 65 of file document.h.
Referenced by get_data(), get_description(), and set_data().
bool Xapian::Document::Internal::data_here [private] |
Definition at line 59 of file document.h.
Referenced by data_modified(), get_data(), get_description(), modified(), and set_data().
Xapian::Internal::RefCntPtr<const Xapian::Database::Internal> Xapian::Document::Internal::database [protected] |
The database this document is in.
Reimplemented in FlintDocument.
Definition at line 52 of file document.h.
Referenced by InMemoryDocument::do_get_data(), ValueStreamDocument::do_get_value(), InMemoryDocument::do_get_value(), get_data(), get_description(), get_value(), need_terms(), need_values(), ValueStreamDocument::new_subdb(), open_term_list(), and ~Internal().
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 79 of file document.h.
Referenced by ChertDocument::do_get_all_values(), BrassDocument::do_get_all_values(), ValueStreamDocument::do_get_data(), InMemoryDocument::do_get_data(), FlintDocument::do_get_data(), ChertDocument::do_get_data(), BrassDocument::do_get_data(), ValueStreamDocument::do_get_value(), InMemoryDocument::do_get_value(), FlintDocument::do_get_value(), ChertDocument::do_get_value(), BrassDocument::do_get_value(), FlintDocument::FlintDocument(), get_docid(), need_terms(), open_term_list(), and ValueStreamDocument::set_document().
bool Xapian::Document::Internal::positions_modified [mutable, private] |
Definition at line 62 of file document.h.
Referenced by add_posting(), clear_terms(), remove_posting(), remove_term(), and term_positions_modified().
document_terms Xapian::Document::Internal::terms [mutable, private] |
The terms (and their frequencies and positions) in this document.
Definition at line 71 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().
bool Xapian::Document::Internal::terms_here [mutable, private] |
Definition at line 61 of file document.h.
Referenced by clear_terms(), get_description(), modified(), need_terms(), open_term_list(), termlist_count(), and terms_modified().
document_values Xapian::Document::Internal::values [mutable, private] |
The values associated with this document.
Definition at line 68 of file document.h.
Referenced by add_value(), clear_values(), get_description(), get_value(), need_values(), remove_value(), set_all_values(), and values_count().
bool Xapian::Document::Internal::values_here [mutable, private] |
Definition at line 60 of file document.h.
Referenced by clear_values(), get_description(), get_value(), modified(), need_values(), set_all_values(), values_count(), and values_modified().