#include <remote-database.h>


Public Member Functions | |
| RemoteDatabase * | as_remotedatabase () |
| Return this pointer as a RemoteDatabase*. | |
| void | keep_alive () |
| Send a keep-alive message. | |
| void | set_query (const Xapian::Query::Internal *query, Xapian::termcount qlen, Xapian::doccount collapse_max, Xapian::valueno collapse_key, Xapian::Enquire::docid_order order, Xapian::valueno sort_key, Xapian::Enquire::Internal::sort_setting sort_by, bool sort_value_forward, int percent_cutoff, Xapian::weight weight_cutoff, const Xapian::Weight *wtscheme, const Xapian::RSet &omrset, const vector< Xapian::MatchSpy * > &matchspies) |
| Set the query. | |
| bool | get_remote_stats (bool nowait, Xapian::Weight::Internal &out) |
| Get the stats from the remote server. | |
| void | send_global_stats (Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount check_at_least, const Xapian::Weight::Internal &stats) |
| Send the global stats to the remote server. | |
| void | get_mset (Xapian::MSet &mset, const vector< Xapian::MatchSpy * > &matchspies) |
| Get the MSet from the remote server. | |
| TermList * | open_metadata_keylist (const std::string &prefix) const |
| Get remote metadata key list. | |
| TermList * | open_term_list (Xapian::docid did) const |
| Get remote termlist. | |
| TermList * | open_allterms (const string &prefix) const |
| Iterate all terms. | |
| bool | has_positions () const |
| Check whether this database contains any positional information. | |
| void | reopen () |
| Reopen the database to the latest available revision. | |
| void | close () |
| Close the database. | |
| LeafPostList * | open_post_list (const string &tname) const |
| Open a posting list. | |
| Xapian::doccount | read_post_list (const string &term, NetworkPostList &pl) const |
| PositionList * | open_position_list (Xapian::docid did, const string &tname) const |
| Open a position list for the given term in the given document. | |
| Xapian::Document::Internal * | open_document (Xapian::docid did, bool lazy) const |
| Get a remote document. | |
| Xapian::doccount | get_doccount () const |
| Get the document count. | |
| Xapian::docid | get_lastdocid () const |
| Get the last used docid. | |
| totlen_t | get_total_length () const |
| Return the total length of all documents in this database. | |
| Xapian::doclength | get_avlength () const |
| Find out the remote average document length. | |
| Xapian::termcount | get_doclength (Xapian::docid did) const |
| Get the length of a given document. | |
| bool | term_exists (const string &tname) const |
| Check if term exists. | |
| Xapian::doccount | get_termfreq (const string &tname) const |
| Find frequency of term. | |
| Xapian::termcount | get_collection_freq (const string &tname) const |
| Return the total number of occurrences of the given term. | |
| void | read_value_stats (Xapian::valueno slot) const |
| Read the value statistics for a value from a remote database. | |
| Xapian::doccount | get_value_freq (Xapian::valueno slot) const |
| Return the frequency of a given value slot. | |
| std::string | get_value_lower_bound (Xapian::valueno slot) const |
| Get a lower bound on the values stored in the given value slot. | |
| std::string | get_value_upper_bound (Xapian::valueno slot) const |
| Get an upper bound on the values stored in the given value slot. | |
| Xapian::termcount | get_doclength_lower_bound () const |
| Get a lower bound on the length of a document in this DB. | |
| Xapian::termcount | get_doclength_upper_bound () const |
| Get an upper bound on the length of a document in this DB. | |
| Xapian::termcount | get_wdf_upper_bound (const string &term) const |
| Get an upper bound on the wdf of term term. | |
| void | commit () |
| Commit pending modifications to the database. | |
| void | cancel () |
| Cancel pending modifications to the database. | |
| Xapian::docid | add_document (const Xapian::Document &doc) |
| Add a new document to the database. | |
| void | delete_document (Xapian::docid did) |
| Delete a document in the database. | |
| void | delete_document (const std::string &unique_term) |
| Delete any documents indexed by a term from the database. | |
| void | replace_document (Xapian::docid did, const Xapian::Document &doc) |
| Replace a given document in the database. | |
| Xapian::docid | replace_document (const std::string &unique_term, const Xapian::Document &document) |
| Replace any documents matching a term. | |
| std::string | get_uuid () const |
| Get a UUID for the database. | |
| string | get_metadata (const string &key) const |
| Get the metadata associated with a given key. | |
| void | set_metadata (const string &key, const string &value) |
| Set the metadata associated with a given key. | |
| void | add_spelling (const std::string &, Xapian::termcount) const |
| Add a word to the spelling dictionary. | |
| void | remove_spelling (const std::string &, Xapian::termcount freqdec) const |
| Remove a word from the spelling dictionary. | |
Protected Member Functions | |
| RemoteDatabase (int fd, double timeout_, const string &context_, bool writable) | |
| Constructor. | |
| reply_type | get_message (string &message, reply_type required_type=REPLY_MAX) const |
| Receive a message from the server. | |
| void | send_message (message_type type, const string &data) const |
| Send a message to the server. | |
| void | do_close () |
| Close the socket. | |
| bool | get_posting (Xapian::docid &did, Xapian::weight &w, string &value) |
Protected Attributes | |
| double | timeout |
| The timeout value used in network communications, in seconds. | |
Private Member Functions | |
| void | operator= (const RemoteDatabase &) |
| Don't allow assignment. | |
| RemoteDatabase (const RemoteDatabase &) | |
| Don't allow copying. | |
| void | update_stats (message_type msg_code=MSG_UPDATE) const |
| void | apply_stats_update (const char *p, const char *p_end) const |
Private Attributes | |
| RemoteConnection | link |
| The object which does the I/O. | |
| Xapian::doccount | doccount |
| The remote document count, given at open. | |
| Xapian::docid | lastdocid |
| The remote last docid, given at open. | |
| Xapian::termcount | doclen_lbound |
| A lower bound on the smallest document length in this database. | |
| Xapian::termcount | doclen_ubound |
| An upper bound on the greatest document length in this database. | |
| totlen_t | total_length |
| The total length of all documents in this database. | |
| bool | has_positional_info |
| Has positional information? | |
| string | uuid |
| The UUID of the remote database. | |
| string | context |
| The context to return with any error messages. | |
| bool | cached_stats_valid |
| ValueStats | mru_valstats |
| The most recently used value statistics. | |
| Xapian::valueno | mru_slot |
| The value slot for the most recently used value statistics. | |
A subclass of this class is required which opens a TCP connection or pipe to the remote database server. This subclass works in combination with the RemoteSubMatch class during the match process.
Definition at line 44 of file remote-database.h.
| RemoteDatabase::RemoteDatabase | ( | const RemoteDatabase & | ) | [private] |
Don't allow copying.
| RemoteDatabase::RemoteDatabase | ( | int | fd, | |
| double | timeout_, | |||
| const string & | context_, | |||
| bool | writable | |||
| ) | [protected] |
Constructor.
The constructor is protected so that raw instances can't be created - a derived class must be instantiated which has code in the constructor to open the socket.
| fd | The file descriptor for the connection to the server. | |
| timeout_ | The timeout used with the network operations. Generally a Xapian::NetworkTimeoutError exception will be thrown if the remote end doesn't respond for this length of time (in seconds). A timeout of 0 means that operations will never timeout. | |
| context_ | The context to return with any error messages. | |
| writable | Is this a WritableDatabase? |
Definition at line 51 of file remote-database.cc.
References apply_stats_update(), context, get_message(), MSG_WRITEACCESS, REPLY_GREETING, Xapian::Internal::str(), STRINGIZE, Xapian::Database::Internal::transaction_state, Xapian::Database::Internal::TRANSACTION_UNIMPLEMENTED, update_stats(), XAPIAN_REMOTE_PROTOCOL_MAJOR_VERSION, and XAPIAN_REMOTE_PROTOCOL_MINOR_VERSION.
| Xapian::docid RemoteDatabase::add_document | ( | const Xapian::Document & | document | ) | [virtual] |
Add a new document to the database.
See WritableDatabase::add_document() for more information.
Reimplemented from Xapian::Database::Internal.
Definition at line 676 of file remote-database.cc.
References Xapian::BAD_VALUENO, cached_stats_valid, decode_length(), get_message(), mru_slot, MSG_ADDDOCUMENT, REPLY_ADDDOCUMENT, send_message(), and serialise_document().
| void RemoteDatabase::add_spelling | ( | const std::string & | word, | |
| Xapian::termcount | freqinc | |||
| ) | const [virtual] |
Add a word to the spelling dictionary.
If the word is already present, its frequency is increased.
| word | The word to add. | |
| freqinc | How much to increase its frequency by. |
Reimplemented from Xapian::Database::Internal.
Definition at line 769 of file remote-database.cc.
References encode_length(), MSG_ADDSPELLING, and send_message().
| void RemoteDatabase::apply_stats_update | ( | const char * | p, | |
| const char * | p_end | |||
| ) | const [private] |
Definition at line 345 of file remote-database.cc.
References cached_stats_valid, context, decode_length(), doccount, doclen_lbound, doclen_ubound, has_positional_info, lastdocid, total_length, and uuid.
Referenced by RemoteDatabase(), and update_stats().
| RemoteDatabase * RemoteDatabase::as_remotedatabase | ( | ) | [virtual] |
Return this pointer as a RemoteDatabase*.
Reimplemented from Xapian::Database::Internal.
Definition at line 113 of file remote-database.cc.
| void RemoteDatabase::cancel | ( | ) | [virtual] |
Cancel pending modifications to the database.
Reimplemented from Xapian::Database::Internal.
Definition at line 667 of file remote-database.cc.
References Xapian::BAD_VALUENO, cached_stats_valid, mru_slot, MSG_CANCEL, and send_message().
| void RemoteDatabase::close | ( | ) | [virtual] |
Close the database.
Implements Xapian::Database::Internal.
Definition at line 296 of file remote-database.cc.
References do_close().
Referenced by ProgClient::run_program().
| void RemoteDatabase::commit | ( | ) | [virtual] |
Commit pending modifications to the database.
See WritableDatabase::commit() for more information.
Reimplemented from Xapian::Database::Internal.
Definition at line 657 of file remote-database.cc.
References get_message(), MSG_COMMIT, REPLY_DONE, and send_message().
| void RemoteDatabase::delete_document | ( | const std::string & | unique_term | ) | [virtual] |
Delete any documents indexed by a term from the database.
See WritableDatabase::delete_document() for more information.
Reimplemented from Xapian::Database::Internal.
Definition at line 703 of file remote-database.cc.
References Xapian::BAD_VALUENO, cached_stats_valid, mru_slot, MSG_DELETEDOCUMENTTERM, and send_message().
| void RemoteDatabase::delete_document | ( | Xapian::docid | did | ) | [virtual] |
Delete a document in the database.
See WritableDatabase::delete_document() for more information.
Reimplemented from Xapian::Database::Internal.
Definition at line 692 of file remote-database.cc.
References Xapian::BAD_VALUENO, cached_stats_valid, dummy, encode_length(), get_message(), mru_slot, MSG_DELETEDOCUMENT, REPLY_DONE, and send_message().
| void RemoteDatabase::do_close | ( | ) | [protected] |
Close the socket.
Definition at line 535 of file remote-database.cc.
References RemoteConnection::do_close(), Xapian::Database::Internal::dtor_called(), link, Xapian::Database::Internal::transaction_state, and Xapian::Database::Internal::TRANSACTION_UNIMPLEMENTED.
Referenced by close(), and ProgClient::~ProgClient().
| Xapian::doclength RemoteDatabase::get_avlength | ( | ) | const [virtual] |
Find out the remote average document length.
Implements Xapian::Database::Internal.
Definition at line 382 of file remote-database.cc.
References cached_stats_valid, doccount, total_length, and update_stats().
| Xapian::termcount RemoteDatabase::get_collection_freq | ( | const string & | tname | ) | const [virtual] |
Return the total number of occurrences of the given term.
This is the sum of the number of occurrences of the term in each document: ie, the sum of the within document frequencies of the term.
| tname | The term whose collection frequency is being requested. |
Implements Xapian::Database::Internal.
Definition at line 414 of file remote-database.cc.
References Assert, decode_length(), get_message(), MSG_COLLFREQ, REPLY_COLLFREQ, and send_message().
| Xapian::doccount RemoteDatabase::get_doccount | ( | ) | const [virtual] |
Get the document count.
Implements Xapian::Database::Internal.
Definition at line 361 of file remote-database.cc.
References cached_stats_valid, doccount, and update_stats().
| Xapian::termcount RemoteDatabase::get_doclength | ( | Xapian::docid | did | ) | const [virtual] |
Get the length of a given document.
Document length, for the purposes of Xapian, is defined to be the number of instances of terms within a document. Expressed differently, the sum of the within document frequencies over all the terms in the document.
| did | The document id of the document whose length is being requested. |
Implements Xapian::Database::Internal.
Definition at line 493 of file remote-database.cc.
References Assert, context, decode_length(), encode_length(), get_message(), MSG_DOCLENGTH, REPLY_DOCLENGTH, and send_message().
| Xapian::termcount RemoteDatabase::get_doclength_lower_bound | ( | ) | const [virtual] |
Get a lower bound on the length of a document in this DB.
Reimplemented from Xapian::Database::Internal.
Definition at line 471 of file remote-database.cc.
References doclen_lbound.
| Xapian::termcount RemoteDatabase::get_doclength_upper_bound | ( | ) | const [virtual] |
Get an upper bound on the length of a document in this DB.
Reimplemented from Xapian::Database::Internal.
Definition at line 477 of file remote-database.cc.
References doclen_ubound.
| Xapian::docid RemoteDatabase::get_lastdocid | ( | ) | const [virtual] |
Get the last used docid.
Implements Xapian::Database::Internal.
Definition at line 368 of file remote-database.cc.
References cached_stats_valid, lastdocid, and update_stats().
| reply_type RemoteDatabase::get_message | ( | string & | message, | |
| reply_type | required_type = REPLY_MAX | |||
| ) | const [protected] |
Receive a message from the server.
Definition at line 509 of file remote-database.cc.
References context, RealTime::end_time(), RemoteConnection::get_message(), link, REPLY_EXCEPTION, REPLY_MAX, Xapian::Internal::str(), timeout, and unserialise_error().
Referenced by add_document(), commit(), delete_document(), get_collection_freq(), get_doclength(), get_metadata(), get_mset(), get_remote_stats(), get_termfreq(), keep_alive(), open_allterms(), open_document(), open_metadata_keylist(), open_position_list(), open_term_list(), read_post_list(), read_value_stats(), RemoteDatabase(), replace_document(), term_exists(), and update_stats().
| string RemoteDatabase::get_metadata | ( | const string & | key | ) | const [virtual] |
Get the metadata associated with a given key.
See Database::get_metadata() for more information.
Reimplemented from Xapian::Database::Internal.
Definition at line 751 of file remote-database.cc.
References get_message(), MSG_GETMETADATA, REPLY_METADATA, and send_message().
| void RemoteDatabase::get_mset | ( | Xapian::MSet & | mset, | |
| const vector< Xapian::MatchSpy * > & | matchspies | |||
| ) |
Get the MSet from the remote server.
Definition at line 636 of file remote-database.cc.
References decode_length(), get_message(), REPLY_RESULTS, and unserialise_mset().
Referenced by RemoteSubMatch::get_mset(), and RemoteSubMatch::get_postlist_and_term_info().
| bool RemoteDatabase::get_posting | ( | Xapian::docid & | did, | |
| Xapian::weight & | w, | |||
| string & | value | |||
| ) | [protected] |
| bool RemoteDatabase::get_remote_stats | ( | bool | nowait, | |
| Xapian::Weight::Internal & | out | |||
| ) |
Get the stats from the remote server.
Definition at line 611 of file remote-database.cc.
References get_message(), link, RemoteConnection::ready_to_read(), REPLY_STATS, and unserialise_stats().
Referenced by RemoteSubMatch::prepare_match().
| Xapian::doccount RemoteDatabase::get_termfreq | ( | const string & | tname | ) | const [virtual] |
Find frequency of term.
Implements Xapian::Database::Internal.
Definition at line 402 of file remote-database.cc.
References Assert, decode_length(), get_message(), MSG_TERMFREQ, REPLY_TERMFREQ, and send_message().
| totlen_t RemoteDatabase::get_total_length | ( | ) | const [virtual] |
Return the total length of all documents in this database.
Implements Xapian::Database::Internal.
Definition at line 375 of file remote-database.cc.
References cached_stats_valid, total_length, and update_stats().
| string RemoteDatabase::get_uuid | ( | ) | const [virtual] |
Get a UUID for the database.
The UUID will persist for the lifetime of the database.
Replicas (eg, made with the replication protocol, or by copying all the database files) will have the same UUID. However, copies (made with copydatabase, or xapian-compact) will have different UUIDs.
If the backend does not support UUIDs the empty string is returned.
Reimplemented from Xapian::Database::Internal.
Definition at line 745 of file remote-database.cc.
References uuid.
| Xapian::doccount RemoteDatabase::get_value_freq | ( | Xapian::valueno | slot | ) | const [virtual] |
Return the frequency of a given value slot.
This is the number of documents which have a (non-empty) value stored in the slot.
| slot | The value slot to examine. |
| UnimplementedError | The frequency of the value isn't available for this database type. |
Reimplemented from Xapian::Database::Internal.
Definition at line 450 of file remote-database.cc.
References ValueStats::freq, mru_valstats, and read_value_stats().
| std::string RemoteDatabase::get_value_lower_bound | ( | Xapian::valueno | slot | ) | const [virtual] |
Get a lower bound on the values stored in the given value slot.
If the lower bound isn't available for the given database type, this will return the lowest possible bound - the empty string.
| slot | The value slot to examine. |
Reimplemented from Xapian::Database::Internal.
Definition at line 457 of file remote-database.cc.
References ValueStats::lower_bound, mru_valstats, and read_value_stats().
| std::string RemoteDatabase::get_value_upper_bound | ( | Xapian::valueno | slot | ) | const [virtual] |
Get an upper bound on the values stored in the given value slot.
| slot | The value slot to examine. |
| UnimplementedError | The upper bound of the values isn't available for this database type. |
Reimplemented from Xapian::Database::Internal.
Definition at line 464 of file remote-database.cc.
References mru_valstats, read_value_stats(), and ValueStats::upper_bound.
| Xapian::termcount RemoteDatabase::get_wdf_upper_bound | ( | const string & | term | ) | const [virtual] |
Get an upper bound on the wdf of term term.
Reimplemented from Xapian::Database::Internal.
Definition at line 483 of file remote-database.cc.
References doclen_ubound.
| bool RemoteDatabase::has_positions | ( | ) | const [virtual] |
Check whether this database contains any positional information.
Implements Xapian::Database::Internal.
Definition at line 282 of file remote-database.cc.
References cached_stats_valid, has_positional_info, and update_stats().
| void RemoteDatabase::keep_alive | ( | ) | [virtual] |
Send a keep-alive message.
Reimplemented from Xapian::Database::Internal.
Definition at line 119 of file remote-database.cc.
References get_message(), MSG_KEEPALIVE, REPLY_DONE, and send_message().
| TermList * RemoteDatabase::open_allterms | ( | const string & | prefix | ) | const [virtual] |
Iterate all terms.
Implements Xapian::Database::Internal.
Definition at line 199 of file remote-database.cc.
References cached_stats_valid, context, decode_length(), doccount, get_message(), MSG_ALLTERMS, REPLY_ALLTERMS, REPLY_DONE, send_message(), NetworkTermListItem::termfreq, NetworkTermListItem::tname, and update_stats().
| Xapian::Document::Internal * RemoteDatabase::open_document | ( | Xapian::docid | did, | |
| bool | lazy | |||
| ) | const [virtual] |
Get a remote document.
Implements Xapian::Database::Internal.
Definition at line 309 of file remote-database.cc.
References Assert, context, decode_length(), encode_length(), get_message(), MSG_DOCUMENT, REPLY_DOCDATA, REPLY_DONE, REPLY_VALUE, and send_message().
| TermList * RemoteDatabase::open_metadata_keylist | ( | const std::string & | prefix | ) | const [virtual] |
Get remote metadata key list.
Reimplemented from Xapian::Database::Internal.
Definition at line 127 of file remote-database.cc.
References cached_stats_valid, context, doccount, get_message(), MSG_METADATAKEYLIST, REPLY_DONE, REPLY_METADATAKEYLIST, send_message(), NetworkTermListItem::tname, and update_stats().
| PositionList * RemoteDatabase::open_position_list | ( | Xapian::docid | did, | |
| const string & | tname | |||
| ) | const [virtual] |
Open a position list for the given term in the given document.
| did | The document id for which a position list is being requested. | |
| tname | The term for which a position list is being requested. |
Implements Xapian::Database::Internal.
Definition at line 259 of file remote-database.cc.
References context, decode_length(), encode_length(), get_message(), MSG_POSITIONLIST, REPLY_DONE, REPLY_POSITIONLIST, and send_message().
| LeafPostList * RemoteDatabase::open_post_list | ( | const string & | tname | ) | const [virtual] |
Open a posting list.
Method defined by subclass to open a posting list. This is a list of all the documents which contain a given term.
| tname | The term whose posting list is being requested. |
Implements Xapian::Database::Internal.
Definition at line 230 of file remote-database.cc.
| TermList * RemoteDatabase::open_term_list | ( | Xapian::docid | did | ) | const [virtual] |
Get remote termlist.
Implements Xapian::Database::Internal.
Definition at line 156 of file remote-database.cc.
References Assert, cached_stats_valid, context, decode_length(), doccount, encode_length(), get_message(), MSG_TERMLIST, REPLY_DOCLENGTH, REPLY_DONE, REPLY_TERMLIST, send_message(), NetworkTermListItem::termfreq, NetworkTermListItem::tname, update_stats(), and NetworkTermListItem::wdf.
| void RemoteDatabase::operator= | ( | const RemoteDatabase & | ) | [private] |
Don't allow assignment.
| Xapian::doccount RemoteDatabase::read_post_list | ( | const string & | term, | |
| NetworkPostList & | pl | |||
| ) | const |
Definition at line 236 of file remote-database.cc.
References NetworkPostList::append_posting(), context, decode_length(), get_message(), MSG_POSTLIST, REPLY_DONE, REPLY_POSTLISTITEM, REPLY_POSTLISTSTART, and send_message().
| void RemoteDatabase::read_value_stats | ( | Xapian::valueno | slot | ) | const |
Read the value statistics for a value from a remote database.
Definition at line 427 of file remote-database.cc.
References context, decode_length(), encode_length(), ValueStats::freq, get_message(), ValueStats::lower_bound, mru_slot, mru_valstats, MSG_VALUESTATS, REPLY_VALUESTATS, send_message(), and ValueStats::upper_bound.
Referenced by get_value_freq(), get_value_lower_bound(), and get_value_upper_bound().
| void RemoteDatabase::remove_spelling | ( | const std::string & | word, | |
| Xapian::termcount | freqdec | |||
| ) | const [virtual] |
Remove a word from the spelling dictionary.
The word's frequency is decreased, and if would become zero or less then the word is removed completely.
| word | The word to remove. | |
| freqdec | How much to decrease its frequency by. |
Reimplemented from Xapian::Database::Internal.
Definition at line 778 of file remote-database.cc.
References encode_length(), MSG_REMOVESPELLING, and send_message().
| void RemoteDatabase::reopen | ( | ) | [virtual] |
Reopen the database to the latest available revision.
Database backends which don't support simultaneous update and reading probably don't need to do anything here.
Reimplemented from Xapian::Database::Internal.
Definition at line 289 of file remote-database.cc.
References Xapian::BAD_VALUENO, mru_slot, MSG_REOPEN, and update_stats().
| Xapian::docid RemoteDatabase::replace_document | ( | const std::string & | unique_term, | |
| const Xapian::Document & | document | |||
| ) | [virtual] |
Replace any documents matching a term.
See WritableDatabase::replace_document() for more information.
Reimplemented from Xapian::Database::Internal.
Definition at line 725 of file remote-database.cc.
References Xapian::BAD_VALUENO, cached_stats_valid, decode_length(), encode_length(), get_message(), mru_slot, MSG_REPLACEDOCUMENTTERM, REPLY_ADDDOCUMENT, send_message(), and serialise_document().
| void RemoteDatabase::replace_document | ( | Xapian::docid | did, | |
| const Xapian::Document & | document | |||
| ) | [virtual] |
Replace a given document in the database.
See WritableDatabase::replace_document() for more information.
Reimplemented from Xapian::Database::Internal.
Definition at line 712 of file remote-database.cc.
References Xapian::BAD_VALUENO, cached_stats_valid, encode_length(), mru_slot, MSG_REPLACEDOCUMENT, send_message(), and serialise_document().
| void RemoteDatabase::send_global_stats | ( | Xapian::doccount | first, | |
| Xapian::doccount | maxitems, | |||
| Xapian::doccount | check_at_least, | |||
| const Xapian::Weight::Internal & | stats | |||
| ) |
Send the global stats to the remote server.
Definition at line 623 of file remote-database.cc.
References encode_length(), MSG_GETMSET, send_message(), and serialise_stats().
Referenced by RemoteSubMatch::start_match().
| void RemoteDatabase::send_message | ( | message_type | type, | |
| const string & | data | |||
| ) | const [protected] |
Send a message to the server.
Definition at line 528 of file remote-database.cc.
References RealTime::end_time(), link, RemoteConnection::send_message(), and timeout.
Referenced by add_document(), add_spelling(), cancel(), commit(), delete_document(), get_collection_freq(), get_doclength(), get_metadata(), get_termfreq(), keep_alive(), open_allterms(), open_document(), open_metadata_keylist(), open_position_list(), open_term_list(), read_post_list(), read_value_stats(), remove_spelling(), replace_document(), send_global_stats(), set_metadata(), set_query(), term_exists(), and update_stats().
| void RemoteDatabase::set_metadata | ( | const string & | key, | |
| const string & | value | |||
| ) | [virtual] |
Set the metadata associated with a given key.
See WritableDatabase::set_metadata() for more information.
Reimplemented from Xapian::Database::Internal.
Definition at line 760 of file remote-database.cc.
References encode_length(), MSG_SETMETADATA, and send_message().
| void RemoteDatabase::set_query | ( | const Xapian::Query::Internal * | query, | |
| Xapian::termcount | qlen, | |||
| Xapian::doccount | collapse_max, | |||
| Xapian::valueno | collapse_key, | |||
| Xapian::Enquire::docid_order | order, | |||
| Xapian::valueno | sort_key, | |||
| Xapian::Enquire::Internal::sort_setting | sort_by, | |||
| bool | sort_value_forward, | |||
| int | percent_cutoff, | |||
| Xapian::weight | weight_cutoff, | |||
| const Xapian::Weight * | wtscheme, | |||
| const Xapian::RSet & | omrset, | |||
| const vector< Xapian::MatchSpy * > & | matchspies | |||
| ) |
Set the query.
| query | The query. | |
| qlen | The query length. | |
| collapse_max | Max number of items with the same key to leave after collapsing (0 for don't collapse). | |
| collapse_key | The value number to collapse matches on. | |
| order | Sort order for docids. | |
| sort_key | The value number to sort on. | |
| sort_by | Which order to apply sorts in. | |
| sort_value_forward | Sort order for values. | |
| percent_cutoff | Percentage cutoff. | |
| weight_cutoff | Weight cutoff. | |
| wtscheme | Weighting scheme. | |
| omrset | The rset. | |
| matchspies | The matchspies to use. NULL if none. |
Definition at line 553 of file remote-database.cc.
References encode_length(), MSG_QUERY, Xapian::Weight::name(), send_message(), Xapian::Weight::serialise(), Xapian::Query::Internal::serialise(), serialise_double(), and serialise_rset().
Referenced by MultiMatch::MultiMatch().
| bool RemoteDatabase::term_exists | ( | const string & | tname | ) | const [virtual] |
Check if term exists.
Implements Xapian::Database::Internal.
Definition at line 389 of file remote-database.cc.
References Assert, context, get_message(), MSG_TERMEXISTS, REPLY_TERMDOESNTEXIST, REPLY_TERMEXISTS, and send_message().
| void RemoteDatabase::update_stats | ( | message_type | msg_code = MSG_UPDATE |
) | const [private] |
Definition at line 334 of file remote-database.cc.
References apply_stats_update(), get_message(), REPLY_UPDATE, and send_message().
Referenced by get_avlength(), get_doccount(), get_lastdocid(), get_total_length(), has_positions(), open_allterms(), open_metadata_keylist(), open_term_list(), RemoteDatabase(), and reopen().
bool RemoteDatabase::cached_stats_valid [mutable, private] |
Definition at line 78 of file remote-database.h.
Referenced by add_document(), apply_stats_update(), cancel(), delete_document(), get_avlength(), get_doccount(), get_lastdocid(), get_total_length(), has_positions(), open_allterms(), open_metadata_keylist(), open_term_list(), and replace_document().
string RemoteDatabase::context [private] |
The context to return with any error messages.
Definition at line 76 of file remote-database.h.
Referenced by apply_stats_update(), get_doclength(), get_message(), open_allterms(), open_document(), open_metadata_keylist(), open_position_list(), open_term_list(), read_post_list(), read_value_stats(), RemoteDatabase(), and term_exists().
Xapian::doccount RemoteDatabase::doccount [mutable, private] |
The remote document count, given at open.
Definition at line 55 of file remote-database.h.
Referenced by apply_stats_update(), get_avlength(), get_doccount(), open_allterms(), open_metadata_keylist(), and open_term_list().
Xapian::termcount RemoteDatabase::doclen_lbound [mutable, private] |
A lower bound on the smallest document length in this database.
Definition at line 61 of file remote-database.h.
Referenced by apply_stats_update(), and get_doclength_lower_bound().
Xapian::termcount RemoteDatabase::doclen_ubound [mutable, private] |
An upper bound on the greatest document length in this database.
Definition at line 64 of file remote-database.h.
Referenced by apply_stats_update(), get_doclength_upper_bound(), and get_wdf_upper_bound().
bool RemoteDatabase::has_positional_info [mutable, private] |
Has positional information?
Definition at line 70 of file remote-database.h.
Referenced by apply_stats_update(), and has_positions().
Xapian::docid RemoteDatabase::lastdocid [mutable, private] |
The remote last docid, given at open.
Definition at line 58 of file remote-database.h.
Referenced by apply_stats_update(), and get_lastdocid().
RemoteConnection RemoteDatabase::link [mutable, private] |
The object which does the I/O.
Definition at line 52 of file remote-database.h.
Referenced by do_close(), get_message(), get_remote_stats(), and send_message().
Xapian::valueno RemoteDatabase::mru_slot [mutable, private] |
The value slot for the most recently used value statistics.
Set to BAD_VALUENO if no value statistics have yet been looked up.
Definition at line 87 of file remote-database.h.
Referenced by add_document(), cancel(), delete_document(), read_value_stats(), reopen(), and replace_document().
ValueStats RemoteDatabase::mru_valstats [mutable, private] |
The most recently used value statistics.
Definition at line 81 of file remote-database.h.
Referenced by get_value_freq(), get_value_lower_bound(), get_value_upper_bound(), and read_value_stats().
double RemoteDatabase::timeout [protected] |
The timeout value used in network communications, in seconds.
Definition at line 122 of file remote-database.h.
Referenced by get_message(), and send_message().
totlen_t RemoteDatabase::total_length [mutable, private] |
The total length of all documents in this database.
Definition at line 67 of file remote-database.h.
Referenced by apply_stats_update(), get_avlength(), and get_total_length().
string RemoteDatabase::uuid [mutable, private] |
The UUID of the remote database.
Definition at line 73 of file remote-database.h.
Referenced by apply_stats_update(), and get_uuid().