1 /** @file remoteprotocol.h
2 * @brief Remote protocol version and message numbers
4 /* Copyright (C) 2006,2007,2008,2009,2010,2011,2013,2014,2015 Olly Betts
5 * Copyright (C) 2007,2010 Lemur Consulting Ltd
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef XAPIAN_INCLUDED_REMOTEPROTOCOL_H
23 #define XAPIAN_INCLUDED_REMOTEPROTOCOL_H
26 // 21: Overhauled remote backend supporting WritableDatabase
27 // 22: Lossless double serialisation
28 // 23: Support get_lastdocid() on remote databases
29 // 24: Support for OP_VALUE_RANGE in query serialisation
30 // 25: Support for delete_document and replace_document with unique term
31 // 26: Tweak delete_document with unique term; delta encode rset and termpos
32 // 27: Support for postlists (always passes the whole list across)
33 // 28: Pass document length in reply to MSG_TERMLIST
34 // 29: Serialisation of Xapian::Error includes error_string
35 // 30: Add minor protocol version numbers, to reduce need for client upgrades
36 // 30.1: Pass the prefix parameter for MSG_ALLTERMS, and use it.
37 // 30.2: New REPLY_DELETEDOCUMENT returns MSG_DONE to allow exceptions.
38 // 30.3: New MSG_GETMSET which passes check_at_least parameter.
39 // 30.4: New query operator OP_SCALE_WEIGHT.
40 // 30.5: New MSG_GETMSET which expects MSet's percent_factor to be returned.
41 // 30.6: Support for OP_VALUE_GE and OP_VALUE_LE in query serialisation
42 // 31: 1.1.0 Clean up for Xapian 1.1.0
43 // 32: 1.1.1 Serialise termfreq and reltermfreqs together in serialise_stats.
44 // 33: 1.1.3 Support for passing matchspies over the remote connection.
45 // 34: 1.1.4 Support for metadata over with remote databases.
46 // 35: 1.1.5 Support for add_spelling() and remove_spelling().
47 // 35.1: 1.2.4 Support for metadata_keys_begin().
48 // 36: 1.3.0 REPLY_UPDATE and REPLY_GREETING merged, and more...
49 // 37: 1.3.1 Prefix-compress termlists.
50 // 38: 1.3.2 Stats serialisation now includes collection freq, and more...
51 // 39: 1.3.3 New query operator OP_WILDCARD; sort keys in serialised MSet.
52 #define XAPIAN_REMOTE_PROTOCOL_MAJOR_VERSION 39
53 #define XAPIAN_REMOTE_PROTOCOL_MINOR_VERSION 0
55 /** Message types (client -> server).
57 * When modifying this list, you probably need to update the array of function
58 * pointers in net/remoteserver.cc too.
61 MSG_ALLTERMS
, // All Terms
62 MSG_COLLFREQ
, // Get Collection Frequency
63 MSG_DOCUMENT
, // Get Document
64 MSG_TERMEXISTS
, // Term Exists?
65 MSG_TERMFREQ
, // Get Term Frequency
66 MSG_VALUESTATS
, // Get value statistics
67 MSG_KEEPALIVE
, // Keep-alive
68 MSG_DOCLENGTH
, // Get Doc Length
69 MSG_QUERY
, // Run Query
70 MSG_TERMLIST
, // Get TermList
71 MSG_POSITIONLIST
, // Get PositionList
72 MSG_POSTLIST
, // Get PostList
74 MSG_UPDATE
, // Get Updated DocCount and AvLength
75 MSG_ADDDOCUMENT
, // Add Document
77 MSG_DELETEDOCUMENTTERM
, // Delete Document by term
79 MSG_REPLACEDOCUMENT
, // Replace Document
80 MSG_REPLACEDOCUMENTTERM
, // Replace Document by term
81 MSG_DELETEDOCUMENT
, // Delete Document
82 MSG_WRITEACCESS
, // Upgrade to WritableDatabase
83 MSG_GETMETADATA
, // Get metadata
84 MSG_SETMETADATA
, // Set metadata
85 MSG_ADDSPELLING
, // Add a spelling
86 MSG_REMOVESPELLING
, // Remove a spelling
87 MSG_GETMSET
, // Get MSet
88 MSG_SHUTDOWN
, // Shutdown
89 MSG_METADATAKEYLIST
, // Iterator for metadata keys
90 MSG_FREQS
, // Get termfreq and collfreq
91 MSG_UNIQUETERMS
, // Get number of unique terms in doc
95 /// Reply types (server -> client).
97 REPLY_UPDATE
, // Updated database stats
98 REPLY_EXCEPTION
, // Exception
99 REPLY_DONE
, // Done sending list
100 REPLY_ALLTERMS
, // All Terms
101 REPLY_COLLFREQ
, // Get Collection Frequency
102 REPLY_DOCDATA
, // Get Document
103 REPLY_TERMDOESNTEXIST
, // Term Doesn't Exist
104 REPLY_TERMEXISTS
, // Term Exists
105 REPLY_TERMFREQ
, // Get Term Frequency
106 REPLY_VALUESTATS
, // Value statistics
107 REPLY_DOCLENGTH
, // Get Doc Length
108 REPLY_STATS
, // Stats
109 REPLY_TERMLIST
, // Get Termlist
110 REPLY_POSITIONLIST
, // Get PositionList
111 REPLY_POSTLISTSTART
, // Start of a postlist
112 REPLY_POSTLISTITEM
, // Item in body of a postlist
113 REPLY_VALUE
, // Document Value
114 REPLY_ADDDOCUMENT
, // Add Document
115 REPLY_RESULTS
, // Results (MSet)
116 REPLY_METADATA
, // Metadata
117 REPLY_METADATAKEYLIST
, // Iterator for metadata keys
118 REPLY_FREQS
, // Get termfreq and collfreq
119 REPLY_UNIQUETERMS
, // Get number of unique terms in doc
123 #endif // XAPIAN_INCLUDED_REMOTEPROTOCOL_H