xapian-core
1.4.27
|
A document in the database, possibly plus modifications. More...
#include <document.h>
Public Types | |
typedef map< Xapian::valueno, string > | document_values |
Type to store values in. More... | |
typedef map< string, OmDocumentTerm > | document_terms |
Type to store terms in. More... | |
Public Member Functions | |
string | get_value (Xapian::valueno slot) const |
Get value by value number. More... | |
void | set_all_values (map< Xapian::valueno, string > &values_) |
Set all the values. More... | |
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) |
Xapian::termpos | remove_postings (const string &, Xapian::termpos, 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. More... | |
void | set_data (const string &) |
TermList * | open_term_list () const |
Open a term list. More... | |
void | need_values () const |
void | need_terms () const |
bool | data_modified () const |
Return true if the data in the document may have been modified. More... | |
bool | values_modified () const |
Return true if the values in the document may have been modified. More... | |
bool | terms_modified () const |
Return true if the terms in the document may have been modified. More... | |
bool | term_positions_modified () const |
Return true if term positions may have been modified. More... | |
bool | modified () const |
Return true if the document may have been modified. More... | |
Xapian::docid | get_docid () const |
Get the docid which is associated with this document (if any). More... | |
string | get_description () const |
Return a string describing this object. More... | |
Internal (Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal > database_, Xapian::docid did_) | |
Constructor. More... | |
Internal () | |
virtual | ~Internal () |
Destructor. More... | |
Public Member Functions inherited from Xapian::Internal::intrusive_base | |
intrusive_base () | |
Construct with no references. More... | |
Protected Attributes | |
Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal > | database |
The database this document is in. More... | |
Xapian::docid | did |
The document ID of the document in that database. More... | |
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. More... | |
document_values | values |
The values associated with this document. More... | |
document_terms | terms |
The terms (and their frequencies and positions) in this document. More... | |
Xapian::termcount | termlist_size |
The number of distinct terms in terms. More... | |
Friends | |
class | ::DocumentValueList |
class | ::ValueStreamDocument |
Additional Inherited Members | |
Public Attributes inherited from Xapian::Internal::intrusive_base | |
unsigned | _refs |
Reference count. More... | |
A document in the database, possibly plus modifications.
Definition at line 43 of file document.h.
typedef map<string, OmDocumentTerm> Xapian::Document::Internal::document_terms |
Type to store terms in.
Definition at line 51 of file document.h.
typedef map<Xapian::valueno, string> Xapian::Document::Internal::document_values |
Type to store values in.
Definition at line 48 of file document.h.
|
private |
|
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 221 of file document.h.
|
inline |
Definition at line 226 of file document.h.
References ~Internal().
|
virtual |
Destructor.
Note that the database object which created this document must still exist at the time this is called.
Definition at line 683 of file omdocument.cc.
Referenced by Internal().
void Xapian::Document::Internal::add_posting | ( | const string & | tname, |
Xapian::termpos | tpos, | ||
Xapian::termcount | wdfinc | ||
) |
Definition at line 473 of file omdocument.cc.
References OmDocumentTerm::append_position().
Referenced by set_all_values().
void Xapian::Document::Internal::add_term | ( | const string & | tname, |
Xapian::termcount | wdfinc | ||
) |
Definition at line 493 of file omdocument.cc.
Referenced by set_all_values().
void Xapian::Document::Internal::add_value | ( | Xapian::valueno | slot, |
const string & | value | ||
) |
Definition at line 440 of file omdocument.cc.
Referenced by set_all_values().
void Xapian::Document::Internal::clear_terms | ( | ) |
Definition at line 582 of file omdocument.cc.
Referenced by set_all_values().
void Xapian::Document::Internal::clear_values | ( | ) |
Definition at line 466 of file omdocument.cc.
Referenced by set_all_values().
|
inline |
Return true if the data in the document may have been modified.
Definition at line 176 of file document.h.
References data_here.
|
inlineprivatevirtual |
Reimplemented in ValueStreamDocument, ChertDocument, GlassDocument, RemoteDocument, and InMemoryDocument.
Definition at line 95 of file document.h.
|
inlineprivatevirtual |
Reimplemented in ValueStreamDocument, ChertDocument, GlassDocument, RemoteDocument, and InMemoryDocument.
Definition at line 98 of file document.h.
References get_value().
|
inlineprivatevirtual |
Reimplemented in ValueStreamDocument, ChertDocument, GlassDocument, RemoteDocument, and InMemoryDocument.
Definition at line 94 of file document.h.
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 413 of file omdocument.cc.
References LOGCALL, and RETURN.
Referenced by set_all_values().
string Xapian::Document::Internal::get_description | ( | ) | const |
Return a string describing this object.
Definition at line 634 of file omdocument.cc.
References description_append(), and Xapian::Internal::str().
Referenced by get_docid().
|
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 211 of file document.h.
References did, and get_description().
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. |
Definition at line 400 of file omdocument.cc.
Referenced by do_get_data(), and Collapser::process().
|
inline |
Return true if the document may have been modified.
Definition at line 198 of file document.h.
References data_here.
void Xapian::Document::Internal::need_terms | ( | ) | const |
Definition at line 605 of file omdocument.cc.
References OmDocumentTerm::append_position().
Referenced by set_all_values().
void Xapian::Document::Internal::need_values | ( | ) | const |
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 429 of file omdocument.cc.
References LOGCALL, and RETURN.
Referenced by InMemoryDatabase::is_closed(), and set_all_values().
void Xapian::Document::Internal::remove_posting | ( | const string & | tname, |
Xapian::termpos | tpos, | ||
Xapian::termcount | wdfdec | ||
) |
Definition at line 510 of file omdocument.cc.
Referenced by set_all_values().
Xapian::termpos Xapian::Document::Internal::remove_postings | ( | const string & | term, |
Xapian::termpos | termpos_first, | ||
Xapian::termpos | termpos_last, | ||
Xapian::termcount | wdf_dec | ||
) |
Definition at line 531 of file omdocument.cc.
References mul_overflows().
Referenced by set_all_values().
void Xapian::Document::Internal::remove_term | ( | const string & | tname | ) |
Definition at line 562 of file omdocument.cc.
Referenced by set_all_values().
void Xapian::Document::Internal::remove_value | ( | Xapian::valueno | slot | ) |
Definition at line 453 of file omdocument.cc.
References Xapian::Internal::str().
Referenced by set_all_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 124 of file document.h.
References add_posting(), add_term(), add_value(), clear_terms(), clear_values(), get_data(), need_terms(), need_values(), open_term_list(), remove_posting(), remove_postings(), remove_term(), remove_value(), set_data(), termlist_count(), and values_count().
Referenced by RemoteDocument::RemoteDocument().
void Xapian::Document::Internal::set_data | ( | const string & | data_ | ) |
Definition at line 422 of file omdocument.cc.
Referenced by RemoteDocument::RemoteDocument(), and set_all_values().
|
inline |
Return true if term positions may have been modified.
Definition at line 193 of file document.h.
References positions_modified.
Xapian::termcount Xapian::Document::Internal::termlist_count | ( | ) | const |
|
inline |
Return true if the terms in the document may have been modified.
Definition at line 188 of file document.h.
References terms_here.
Xapian::valueno Xapian::Document::Internal::values_count | ( | ) | const |
Definition at line 625 of file omdocument.cc.
References Assert, LOGCALL, and RETURN.
Referenced by set_all_values().
|
inline |
Return true if the values in the document may have been modified.
Definition at line 182 of file document.h.
References values_here.
|
friend |
Definition at line 44 of file document.h.
|
friend |
Definition at line 45 of file document.h.
|
private |
The (user defined) data associated with this document.
Definition at line 68 of file document.h.
|
private |
Definition at line 62 of file document.h.
Referenced by data_modified(), and modified().
|
protected |
The database this document is in.
Definition at line 55 of file document.h.
Referenced by InMemoryDocument::do_get_all_values(), InMemoryDocument::do_get_data(), and InMemoryDocument::do_get_value().
|
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 90 of file document.h.
Referenced by InMemoryDocument::do_get_all_values(), ChertDocument::do_get_all_values(), GlassDocument::do_get_all_values(), InMemoryDocument::do_get_data(), ChertDocument::do_get_data(), GlassDocument::do_get_data(), InMemoryDocument::do_get_value(), ChertDocument::do_get_value(), GlassDocument::do_get_value(), get_docid(), InMemoryDatabase::is_closed(), and ValueStreamDocument::set_document().
|
mutableprivate |
Definition at line 65 of file document.h.
Referenced by term_positions_modified().
|
mutableprivate |
The number of distinct terms in terms.
Only valid when terms_here is true.
This may be less than terms.size() if any terms have been deleted.
Definition at line 82 of file document.h.
|
mutableprivate |
The terms (and their frequencies and positions) in this document.
Definition at line 74 of file document.h.
|
mutableprivate |
Definition at line 64 of file document.h.
Referenced by terms_modified().
|
mutableprivate |
The values associated with this document.
Definition at line 71 of file document.h.
|
mutableprivate |
Definition at line 63 of file document.h.
Referenced by values_modified().