2 * @brief Remote protocol version and message numbers
4 /* Copyright (C) 2006-2024 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 // 39.1: pre-1.5.0 MSG_POSITIONLISTCOUNT added.
53 // 40: pre-1.5.0 REPLY_REMOVESPELLING added.
54 // 41: pre-1.5.0 Changed REPLY_ALLTERMS, REPLY_METADATAKEYLIST, REPLY_TERMLIST.
55 // 42: pre-1.5.0 Use little-endian IEEE for doubles
56 // 43: pre-1.5.0 REPLY_DONE sent for 5 more messages; MSG_QUERY adjusted
57 // 44: pre-1.5.0 pack_uint() now used; many other changes
58 // 44.1: pre-1.5.0 MSG_RECONSTRUCTTEXT added
59 // 45: pre-1.5.0 Remote support for sorters
60 // 46: pre-1.5.0 Drop unused fields; front-code term names in serialised stats
61 // 46.1: pre-1.5.0 MSG_REQUESTDOCUMENT added
62 // 47: 1.5.0 Updated Weight::Internal serialisation for db_*_bound
63 #define XAPIAN_REMOTE_PROTOCOL_MAJOR_VERSION 47
64 #define XAPIAN_REMOTE_PROTOCOL_MINOR_VERSION 0
66 /** Message types (client -> server).
68 * When modifying this list, you probably need to update the switch statement
69 * in net/remoteserver.cc too.
72 MSG_ALLTERMS
, // All Terms
73 MSG_COLLFREQ
, // Get Collection Frequency
74 MSG_DOCUMENT
, // Get Document
75 MSG_TERMEXISTS
, // Term Exists?
76 MSG_TERMFREQ
, // Get Term Frequency
77 MSG_VALUESTATS
, // Get value statistics
78 MSG_KEEPALIVE
, // Keep-alive
79 MSG_DOCLENGTH
, // Get Doc Length
80 MSG_QUERY
, // Run Query
81 MSG_TERMLIST
, // Get TermList
82 MSG_POSITIONLIST
, // Get PositionList
83 MSG_POSTLIST
, // Get PostList
85 MSG_UPDATE
, // Get Updated DocCount and AvLength
86 MSG_ADDDOCUMENT
, // Add Document
88 MSG_DELETEDOCUMENTTERM
, // Delete Document by term
90 MSG_REPLACEDOCUMENT
, // Replace Document
91 MSG_REPLACEDOCUMENTTERM
, // Replace Document by term
92 MSG_DELETEDOCUMENT
, // Delete Document
93 MSG_WRITEACCESS
, // Upgrade to WritableDatabase
94 MSG_GETMETADATA
, // Get metadata
95 MSG_SETMETADATA
, // Set metadata
96 MSG_ADDSPELLING
, // Add a spelling
97 MSG_REMOVESPELLING
, // Remove a spelling
98 MSG_GETMSET
, // Get MSet
99 MSG_SHUTDOWN
, // Shutdown
100 MSG_METADATAKEYLIST
, // Iterator for metadata keys
101 MSG_FREQS
, // Get termfreq and collfreq
102 MSG_UNIQUETERMS
, // Get number of unique terms in doc
103 MSG_WDFDOCMAX
, // Get the max_wdf in doc
104 MSG_POSITIONLISTCOUNT
, // Get PositionList length
105 MSG_RECONSTRUCTTEXT
, // Reconstruct document text
106 MSG_SYNONYMTERMLIST
, // Get synonyms for a term
107 MSG_SYNONYMKEYLIST
, // Get terms with an entry in synonym table
108 MSG_ADDSYNONYM
, // Add a synonym
109 MSG_REMOVESYNONYM
, // Remove a synonym
110 MSG_CLEARSYNONYMS
, // Clear synonyms for a term
111 MSG_REQUESTDOCUMENT
, // Request a document (pre-read hint)
115 /// Reply types (server -> client).
117 REPLY_UPDATE
, // Updated database stats
118 REPLY_EXCEPTION
, // Exception
119 REPLY_DONE
, // Done sending list
120 REPLY_ALLTERMS
, // All Terms
121 REPLY_COLLFREQ
, // Get Collection Frequency
122 REPLY_DOCDATA
, // Get Document
123 REPLY_TERMDOESNTEXIST
, // Term Doesn't Exist
124 REPLY_TERMEXISTS
, // Term Exists
125 REPLY_TERMFREQ
, // Get Term Frequency
126 REPLY_VALUESTATS
, // Value statistics
127 REPLY_DOCLENGTH
, // Get Doc Length
128 REPLY_STATS
, // Stats
129 REPLY_TERMLIST
, // Get Termlist
130 REPLY_POSITIONLIST
, // Get PositionList
131 REPLY_POSTLISTHEADER
, // Header for get postlist
132 REPLY_POSTLIST
, // Get Postlist
133 REPLY_VALUE
, // Document Value
134 REPLY_ADDDOCUMENT
, // Add Document
135 REPLY_RESULTS
, // Results (MSet)
136 REPLY_METADATA
, // Metadata
137 REPLY_METADATAKEYLIST
, // Iterator for metadata keys
138 REPLY_FREQS
, // Get termfreq and collfreq
139 REPLY_UNIQUETERMS
, // Get number of unique terms in doc
140 REPLY_WDFDOCMAX
, // Get the max_wdf in doc
141 REPLY_POSITIONLISTCOUNT
, // Get PositionList length
142 REPLY_REMOVESPELLING
, // Remove a spelling
143 REPLY_TERMLISTHEADER
, // Header for get termlist
144 REPLY_RECONSTRUCTTEXT
, // Reconstruct document text
145 REPLY_SYNONYMTERMLIST
, // Get synonyms for a term
146 REPLY_SYNONYMKEYLIST
, // Get terms with an entry in synonym table
150 #endif // XAPIAN_INCLUDED_REMOTEPROTOCOL_H