00001 00004 /* Copyright (C) 2006,2007,2008,2009,2010 Olly Betts 00005 * Copyright (C) 2007,2010 Lemur Consulting Ltd 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef XAPIAN_INCLUDED_REMOTEPROTOCOL_H 00023 #define XAPIAN_INCLUDED_REMOTEPROTOCOL_H 00024 00025 // Versions: 00026 // 21: Overhauled remote backend supporting WritableDatabase 00027 // 22: Lossless double serialisation 00028 // 23: Support get_lastdocid() on remote databases 00029 // 24: Support for OP_VALUE_RANGE in query serialisation 00030 // 25: Support for delete_document and replace_document with unique term 00031 // 26: Tweak delete_document with unique term; delta encode rset and termpos 00032 // 27: Support for postlists (always passes the whole list across) 00033 // 28: Pass document length in reply to MSG_TERMLIST 00034 // 29: Serialisation of Xapian::Error includes error_string 00035 // 30: Add minor protocol version numbers, to reduce need for client upgrades 00036 // 30.1: Pass the prefix parameter for MSG_ALLTERMS, and use it. 00037 // 30.2: New REPLY_DELETEDOCUMENT returns MSG_DONE to allow exceptions. 00038 // 30.3: New MSG_GETMSET which passes check_at_least parameter. 00039 // 30.4: New query operator OP_SCALE_WEIGHT. 00040 // 30.5: New MSG_GETMSET which expects MSet's percent_factor to be returned. 00041 // 30.6: Support for OP_VALUE_GE and OP_VALUE_LE in query serialisation 00042 // 31: 1.1.0 Clean up for Xapian 1.1.0 00043 // 32: 1.1.1 Serialise termfreq and reltermfreqs together in serialise_stats. 00044 // 33: 1.1.3 Support for passing matchspies over the remote connection. 00045 // 34: 1.1.4 Support for metadata over with remote databases. 00046 // 35: 1.1.5 Support for add_spelling() and remove_spelling(). 00047 // 35.1: 1.2.4 Support for metadata_keys_begin(). 00048 #define XAPIAN_REMOTE_PROTOCOL_MAJOR_VERSION 35 00049 #define XAPIAN_REMOTE_PROTOCOL_MINOR_VERSION 1 00050 00056 enum message_type { 00057 MSG_ALLTERMS, // All Terms 00058 MSG_COLLFREQ, // Get Collection Frequency 00059 MSG_DOCUMENT, // Get Document 00060 MSG_TERMEXISTS, // Term Exists? 00061 MSG_TERMFREQ, // Get Term Frequency 00062 MSG_VALUESTATS, // Get value statistics 00063 MSG_KEEPALIVE, // Keep-alive 00064 MSG_DOCLENGTH, // Get Doc Length 00065 MSG_QUERY, // Run Query 00066 MSG_TERMLIST, // Get TermList 00067 MSG_POSITIONLIST, // Get PositionList 00068 MSG_POSTLIST, // Get PostList 00069 MSG_REOPEN, // Reopen 00070 MSG_UPDATE, // Get Updated DocCount and AvLength 00071 MSG_ADDDOCUMENT, // Add Document 00072 MSG_CANCEL, // Cancel 00073 MSG_DELETEDOCUMENTTERM, // Delete Document by term 00074 MSG_COMMIT, // Commit 00075 MSG_REPLACEDOCUMENT, // Replace Document 00076 MSG_REPLACEDOCUMENTTERM, // Replace Document by term 00077 MSG_DELETEDOCUMENT, // Delete Document 00078 MSG_WRITEACCESS, // Upgrade to WritableDatabase 00079 MSG_GETMETADATA, // Get metadata 00080 MSG_SETMETADATA, // Set metadata 00081 MSG_ADDSPELLING, // Add a spelling 00082 MSG_REMOVESPELLING, // Remove a spelling 00083 MSG_GETMSET, // Get MSet 00084 MSG_SHUTDOWN, // Shutdown 00085 MSG_METADATAKEYLIST, // Iterator for metadata keys 00086 MSG_MAX 00087 }; 00088 00090 enum reply_type { 00091 REPLY_GREETING, // Greeting 00092 REPLY_EXCEPTION, // Exception 00093 REPLY_DONE, // Done sending list 00094 REPLY_ALLTERMS, // All Terms 00095 REPLY_COLLFREQ, // Get Collection Frequency 00096 REPLY_DOCDATA, // Get Document 00097 REPLY_TERMDOESNTEXIST, // Term Doesn't Exist 00098 REPLY_TERMEXISTS, // Term Exists 00099 REPLY_TERMFREQ, // Get Term Frequency 00100 REPLY_VALUESTATS, // Value statistics 00101 REPLY_DOCLENGTH, // Get Doc Length 00102 REPLY_STATS, // Stats 00103 REPLY_TERMLIST, // Get Termlist 00104 REPLY_POSITIONLIST, // Get PositionList 00105 REPLY_POSTLISTSTART, // Start of a postlist 00106 REPLY_POSTLISTITEM, // Item in body of a postlist 00107 REPLY_UPDATE, // Get Updated DocCount and AvLength 00108 REPLY_VALUE, // Document Value 00109 REPLY_ADDDOCUMENT, // Add Document 00110 REPLY_RESULTS, // Results (MSet) 00111 REPLY_METADATA, // Metadata 00112 REPLY_METADATAKEYLIST, // Iterator for metadata keys 00113 REPLY_MAX 00114 }; 00115 00116 #endif // XAPIAN_INCLUDED_REMOTEPROTOCOL_H