xapian-core
1.4.22
|
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... | |
![]() | |
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 | |
![]() | |
unsigned | _refs |
Reference count. More... | |
A document in the database, possibly plus modifications.
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 49 of file document.h.
typedef map<Xapian::valueno, string> Xapian::Document::Internal::document_values |
Type to store values in.
Definition at line 46 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 219 of file document.h.
|
inline |
Definition at line 224 of file document.h.
|
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.
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().
void Xapian::Document::Internal::add_term | ( | const string & | tname, |
Xapian::termcount | wdfinc | ||
) |
Definition at line 493 of file omdocument.cc.
void Xapian::Document::Internal::add_value | ( | Xapian::valueno | slot, |
const string & | value | ||
) |
Definition at line 440 of file omdocument.cc.
void Xapian::Document::Internal::clear_terms | ( | ) |
Definition at line 582 of file omdocument.cc.
void Xapian::Document::Internal::clear_values | ( | ) |
Definition at line 466 of file omdocument.cc.
|
inline |
Return true if the data in the document may have been modified.
Definition at line 174 of file document.h.
|
inlineprivatevirtual |
Reimplemented in ValueStreamDocument, ChertDocument, GlassDocument, RemoteDocument, and InMemoryDocument.
Definition at line 93 of file document.h.
|
inlineprivatevirtual |
Reimplemented in ValueStreamDocument, ChertDocument, GlassDocument, RemoteDocument, and InMemoryDocument.
Definition at line 96 of file document.h.
|
inlineprivatevirtual |
Reimplemented in ValueStreamDocument, ChertDocument, GlassDocument, RemoteDocument, and InMemoryDocument.
Definition at line 92 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.
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().
|
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 209 of file document.h.
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 Collapser::process().
|
inline |
Return true if the document may have been modified.
Definition at line 196 of file document.h.
void Xapian::Document::Internal::need_terms | ( | ) | const |
Definition at line 605 of file omdocument.cc.
References OmDocumentTerm::append_position().
void Xapian::Document::Internal::need_values | ( | ) | const |
Definition at line 672 of file omdocument.cc.
References Assert.
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().
void Xapian::Document::Internal::remove_posting | ( | const string & | tname, |
Xapian::termpos | tpos, | ||
Xapian::termcount | wdfdec | ||
) |
Definition at line 510 of file omdocument.cc.
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().
void Xapian::Document::Internal::remove_term | ( | const string & | tname | ) |
Definition at line 562 of file omdocument.cc.
void Xapian::Document::Internal::remove_value | ( | Xapian::valueno | slot | ) |
Definition at line 453 of file omdocument.cc.
References Xapian::Internal::str().
|
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 122 of file document.h.
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().
|
inline |
Return true if term positions may have been modified.
Definition at line 191 of file document.h.
Xapian::termcount Xapian::Document::Internal::termlist_count | ( | ) | const |
Definition at line 593 of file omdocument.cc.
References Assert.
|
inline |
Return true if the terms in the document may have been modified.
Definition at line 186 of file document.h.
Xapian::valueno Xapian::Document::Internal::values_count | ( | ) | const |
Definition at line 625 of file omdocument.cc.
|
inline |
Return true if the values in the document may have been modified.
Definition at line 180 of file document.h.
|
friend |
Definition at line 42 of file document.h.
|
friend |
Definition at line 43 of file document.h.
|
private |
The (user defined) data associated with this document.
Definition at line 66 of file document.h.
|
private |
Definition at line 60 of file document.h.
|
protected |
The database this document is in.
Definition at line 53 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 88 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(), InMemoryDatabase::is_closed(), and ValueStreamDocument::set_document().
|
mutableprivate |
Definition at line 63 of file document.h.
|
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 80 of file document.h.
|
mutableprivate |
The terms (and their frequencies and positions) in this document.
Definition at line 72 of file document.h.
|
mutableprivate |
Definition at line 62 of file document.h.
|
mutableprivate |
The values associated with this document.
Definition at line 69 of file document.h.
|
mutableprivate |
Definition at line 61 of file document.h.