common/remoteprotocol.h

Go to the documentation of this file.
00001 
00004 /* Copyright (C) 2006,2007 Olly Betts
00005  * Copyright (C) 2007 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 #define XAPIAN_REMOTE_PROTOCOL_MAJOR_VERSION 30
00043 #define XAPIAN_REMOTE_PROTOCOL_MINOR_VERSION 6
00044 
00045 /* When we move to version 31:
00046  * + Remove MSG_DELETEDOCUMENT_PRE_30_2
00047  * + Remove MSG_GETMSET_PRE_30_3
00048  * + Remove MSG_GETMSET_PRE_30_5
00049  * + Remove REPLY_RESULTS_PRE_30_5
00050  * Include MSet::Internal::percent_factor in the MSet serialisation.
00051  */
00052 
00054 enum message_type {
00055     MSG_ALLTERMS,               // All Terms
00056     MSG_COLLFREQ,               // Get Collection Frequency
00057     MSG_DOCUMENT,               // Get Document
00058     MSG_TERMEXISTS,             // Term Exists?
00059     MSG_TERMFREQ,               // Get Term Frequency
00060     MSG_KEEPALIVE,              // Keep-alive
00061     MSG_DOCLENGTH,              // Get Doc Length
00062     MSG_QUERY,                  // Run Query
00063     MSG_TERMLIST,               // Get TermList
00064     MSG_POSITIONLIST,           // Get PositionList
00065     MSG_POSTLIST,               // Get PostList
00066     MSG_REOPEN,                 // Reopen
00067     MSG_UPDATE,                 // Get Updated DocCount and AvLength
00068     MSG_ADDDOCUMENT,            // Add Document
00069     MSG_CANCEL,                 // Cancel
00070     MSG_DELETEDOCUMENT_PRE_30_2,// Delete Document for < 30.2.
00071     MSG_DELETEDOCUMENTTERM,     // Delete Document by term
00072     MSG_FLUSH,                  // Flush
00073     MSG_REPLACEDOCUMENT,        // Replace Document
00074     MSG_REPLACEDOCUMENTTERM,    // Replace Document by term
00075     MSG_GETMSET_PRE_30_3,       // Get MSet for < 30.3
00076     MSG_SHUTDOWN,               // Shutdown
00077     MSG_DELETEDOCUMENT,         // Delete Document
00078     MSG_GETMSET_PRE_30_5,       // Get MSet for < 30.5
00079     MSG_GETMSET,                // Get MSet
00080     MSG_MAX
00081 };
00082 
00084 enum reply_type {
00085     REPLY_GREETING,             // Greeting
00086     REPLY_EXCEPTION,            // Exception
00087     REPLY_DONE,                 // Done sending list
00088     REPLY_ALLTERMS,             // All Terms
00089     REPLY_COLLFREQ,             // Get Collection Frequency
00090     REPLY_DOCDATA,              // Get Document
00091     REPLY_TERMDOESNTEXIST,      // Term Doesn't Exist
00092     REPLY_TERMEXISTS,           // Term Exists
00093     REPLY_TERMFREQ,             // Get Term Frequency
00094     REPLY_DOCLENGTH,            // Get Doc Length
00095     REPLY_RESULTS_PRE_30_5,     // Results (MSet) for < 30.5
00096     REPLY_STATS,                // Stats
00097     REPLY_TERMLIST,             // Get Termlist
00098     REPLY_POSITIONLIST,         // Get PositionList
00099     REPLY_POSTLISTSTART,        // Start of a postlist
00100     REPLY_POSTLISTITEM,         // Item in body of a postlist
00101     REPLY_UPDATE,               // Get Updated DocCount and AvLength
00102     REPLY_VALUE,                // Document Value
00103     REPLY_ADDDOCUMENT,          // Add Document
00104     REPLY_RESULTS,              // Results (MSet)
00105     REPLY_MAX
00106 };
00107 
00108 #endif // XAPIAN_INCLUDED_REMOTEPROTOCOL_H

Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.