39 Document::Internal::ensure_terms_fetched()
const
44 terms.reset(
new map<
string,
TermInfo, std::less<>>());
49 unique_ptr<TermList> t(database->open_term_list(did));
50 while (t->next() == NULL) {
52 auto&& r = terms->emplace_hint(terms->end(),
56 unique_ptr<PositionList>
p(t->positionlist_begin());
66 Document::Internal::ensure_values_fetched()
const
71 values.reset(
new map<Xapian::valueno, string>());
73 fetch_all_values(*values);
78 Document::Internal::fetch_data()
const
85 string>& values_)
const
96 Document::Internal::~Internal()
99 database->invalidate_doc_object(
this);
103 Document::Internal::open_term_list()
const
111 return database->open_term_list(did);
115 Document::Internal::values_begin()
const
117 if (!values && database) {
118 values.reset(
new map<Xapian::valueno, string>());
119 fetch_all_values(*values);
122 if (!values || values->empty())
129 Document::Internal::get_description()
const
131 string desc =
"Document(docid=";
141 desc +=
str(terms->size());
147 desc +=
str(values->size());
153 desc += database->get_description();
Iteration over terms in a document.
Iteration over values in a document.
Metadata for a term in a document.
virtual bool next()=0
Advance to the next entry in the positionlist.
virtual Xapian::termpos get_position() const =0
Return the current position.
Abstract base class for termlists.
Class for iterating over document values.
Append a string to an object description, escaping invalid UTF-8.
Abstract base class for a document.
Iteration over terms in a document.
Iteration over values in a document.
string str(int value)
Convert int to std::string.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned valueno
The number for a value slot in a document.
Convert types to std::string.
void description_append(std::string &desc, std::string_view s)
Class for iterating over document values.