xapian-core
1.4.26
|
functions to convert Xapian objects to strings and back More...
#include <config.h>
#include <xapian/document.h>
#include <xapian/positioniterator.h>
#include <xapian/termiterator.h>
#include <xapian/valueiterator.h>
#include "omassert.h"
#include "api/omenquireinternal.h"
#include "length.h"
#include "serialise.h"
#include "serialise-double.h"
#include "weight/weightinternal.h"
#include "autoptr.h"
#include <set>
#include <string>
Go to the source code of this file.
Functions | |
string | serialise_stats (const Xapian::Weight::Internal &stats) |
Serialise a stats object. More... | |
void | unserialise_stats (const char *p, const char *p_end, Xapian::Weight::Internal &stat) |
Unserialise a serialised stats object. More... | |
string | serialise_mset (const Xapian::MSet &mset) |
Serialise a Xapian::MSet object. More... | |
Xapian::MSet | unserialise_mset (const char *p, const char *p_end) |
Unserialise a serialised Xapian::MSet object. More... | |
string | serialise_rset (const Xapian::RSet &rset) |
Serialise a Xapian::RSet object. More... | |
Xapian::RSet | unserialise_rset (const string &s) |
Unserialise a serialised Xapian::RSet object. More... | |
string | serialise_document (const Xapian::Document &doc) |
Serialise a Xapian::Document object. More... | |
Xapian::Document | unserialise_document (const string &s) |
Unserialise a serialised Xapian::Document object. More... | |
functions to convert Xapian objects to strings and back
Definition in file serialise.cc.
string serialise_document | ( | const Xapian::Document & | doc | ) |
Serialise a Xapian::Document object.
doc | The object to serialise. |
Definition at line 251 of file serialise.cc.
References Assert, AssertEq, encode_length(), Xapian::Document::get_data(), Xapian::ValueIterator::get_valueno(), Xapian::TermIterator::get_wdf(), Xapian::TermIterator::positionlist_begin(), Xapian::TermIterator::positionlist_count(), Xapian::TermIterator::positionlist_end(), Xapian::Document::termlist_begin(), Xapian::Document::termlist_count(), Xapian::Document::termlist_end(), Xapian::Document::values_begin(), Xapian::Document::values_count(), and Xapian::Document::values_end().
Referenced by RemoteDatabase::add_document(), RemoteDatabase::replace_document(), and Xapian::Document::serialise().
string serialise_mset | ( | const Xapian::MSet & | mset | ) |
Serialise a Xapian::MSet object.
mset | The object to serialise. |
Definition at line 113 of file serialise.cc.
References Xapian::Internal::MSetItem::collapse_count, Xapian::Internal::MSetItem::collapse_key, Xapian::Internal::MSetItem::did, encode_length(), Xapian::MSet::get_firstitem(), Xapian::MSet::get_max_attained(), Xapian::MSet::get_max_possible(), Xapian::MSet::get_uncollapsed_matches_estimated(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::MSet::get_uncollapsed_matches_upper_bound(), Xapian::MSet::internal, serialise_double(), serialise_stats(), Xapian::MSet::size(), Xapian::Internal::MSetItem::sort_key, and Xapian::Internal::MSetItem::wt.
Referenced by RemoteServer::msg_query().
string serialise_rset | ( | const Xapian::RSet & | omrset | ) |
Serialise a Xapian::RSet object.
rset | The object to serialise. |
Definition at line 217 of file serialise.cc.
References encode_length(), and Xapian::RSet::internal.
Referenced by RemoteDatabase::set_query().
string serialise_stats | ( | const Xapian::Weight::Internal & | stats | ) |
Serialise a stats object.
stats | The stats object to serialise. |
Definition at line 42 of file serialise.cc.
References Xapian::Weight::Internal::collection_size, encode_length(), Xapian::Weight::Internal::have_max_part, Xapian::Weight::Internal::rset_size, serialise_double(), Xapian::Weight::Internal::termfreqs, and Xapian::Weight::Internal::total_length.
Referenced by RemoteServer::msg_query(), RemoteDatabase::send_global_stats(), and serialise_mset().
Xapian::Document unserialise_document | ( | const std::string & | s | ) |
Unserialise a serialised Xapian::Document object.
s | The serialised object as a string. |
Definition at line 295 of file serialise.cc.
References Xapian::Document::add_posting(), Xapian::Document::add_term(), Xapian::Document::add_value(), decode_length(), decode_length_and_check(), and Xapian::Document::set_data().
Referenced by RemoteServer::msg_adddocument(), RemoteServer::msg_replacedocument_(), RemoteServer::msg_replacedocumentterm(), and Xapian::Document::unserialise().
Xapian::MSet unserialise_mset | ( | const char * | p, |
const char * | p_end | ||
) |
Unserialise a serialised Xapian::MSet object.
p | Pointer to the start of the string to unserialise. |
p_end | Pointer to the end of the string to unserialise. |
Definition at line 154 of file serialise.cc.
References decode_length(), decode_length_and_check(), Xapian::MSet::internal, unserialise_double(), and unserialise_stats().
Referenced by RemoteDatabase::get_mset().
Xapian::RSet unserialise_rset | ( | const std::string & | s | ) |
Unserialise a serialised Xapian::RSet object.
s | The serialised object as a string. |
Definition at line 232 of file serialise.cc.
References Xapian::RSet::add_document(), decode_length(), and Xapian::RSet::size().
Referenced by RemoteServer::msg_query().
void unserialise_stats | ( | const char * | p, |
const char * | p_end, | ||
Xapian::Weight::Internal & | stats | ||
) |
Unserialise a serialised stats object.
p | Pointer to data to unserialise. |
p_end | End of data to unserialise. |
stats | The stats object to unserialise to. |
Definition at line 71 of file serialise.cc.
References Xapian::Weight::Internal::collection_size, decode_length(), decode_length_and_check(), dummy, Xapian::Weight::Internal::have_max_part, Xapian::Weight::Internal::rset_size, Xapian::Weight::Internal::termfreqs, Xapian::Weight::Internal::total_length, and unserialise_double().
Referenced by RemoteDatabase::get_remote_stats(), RemoteServer::msg_query(), and unserialise_mset().