xapian-core  1.4.27
remoteprotocol.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2006,2007,2008,2009,2010,2011,2013,2014,2015 Olly Betts
5  * Copyright (C) 2007,2010 Lemur Consulting Ltd
6  *
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.
11  *
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.
16  *
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
20  */
21 
22 #ifndef XAPIAN_INCLUDED_REMOTEPROTOCOL_H
23 #define XAPIAN_INCLUDED_REMOTEPROTOCOL_H
24 
25 // Versions:
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: 1.4.12 REPLY_DONE sent for 5 more messages
53 #define XAPIAN_REMOTE_PROTOCOL_MAJOR_VERSION 39
54 #define XAPIAN_REMOTE_PROTOCOL_MINOR_VERSION 1
55 
62  MSG_ALLTERMS, // All Terms
63  MSG_COLLFREQ, // Get Collection Frequency
64  MSG_DOCUMENT, // Get Document
65  MSG_TERMEXISTS, // Term Exists?
66  MSG_TERMFREQ, // Get Term Frequency
67  MSG_VALUESTATS, // Get value statistics
68  MSG_KEEPALIVE, // Keep-alive
69  MSG_DOCLENGTH, // Get Doc Length
70  MSG_QUERY, // Run Query
71  MSG_TERMLIST, // Get TermList
72  MSG_POSITIONLIST, // Get PositionList
73  MSG_POSTLIST, // Get PostList
74  MSG_REOPEN, // Reopen
75  MSG_UPDATE, // Get Updated DocCount and AvLength
76  MSG_ADDDOCUMENT, // Add Document
77  MSG_CANCEL_, // Cancel (compat)
78  MSG_DELETEDOCUMENTTERM_, // Delete Document by term (compat)
79  MSG_COMMIT, // Commit
80  MSG_REPLACEDOCUMENT_, // Replace Document (compat)
81  MSG_REPLACEDOCUMENTTERM, // Replace Document by term
82  MSG_DELETEDOCUMENT, // Delete Document
83  MSG_WRITEACCESS, // Upgrade to WritableDatabase
84  MSG_GETMETADATA, // Get metadata
85  MSG_SETMETADATA_, // Set metadata (compat)
86  MSG_ADDSPELLING_, // Add a spelling (compat)
87  MSG_REMOVESPELLING, // Remove a spelling
88  MSG_GETMSET, // Get MSet
89  MSG_SHUTDOWN, // Shutdown
90  MSG_METADATAKEYLIST, // Iterator for metadata keys
91  MSG_FREQS, // Get termfreq and collfreq
92  MSG_UNIQUETERMS, // Get number of unique terms in doc
93  MSG_DELETEDOCUMENTTERM, // Delete Document by term
94  MSG_REPLACEDOCUMENT, // Replace Document
95  MSG_CANCEL, // Cancel
96  MSG_SETMETADATA, // Set metadata
97  MSG_ADDSPELLING, // Add a spelling
99 };
100 
103  REPLY_UPDATE, // Updated database stats
104  REPLY_EXCEPTION, // Exception
105  REPLY_DONE, // Done sending list
106  REPLY_ALLTERMS, // All Terms
107  REPLY_COLLFREQ, // Get Collection Frequency
108  REPLY_DOCDATA, // Get Document
109  REPLY_TERMDOESNTEXIST, // Term Doesn't Exist
110  REPLY_TERMEXISTS, // Term Exists
111  REPLY_TERMFREQ, // Get Term Frequency
112  REPLY_VALUESTATS, // Value statistics
113  REPLY_DOCLENGTH, // Get Doc Length
114  REPLY_STATS, // Stats
115  REPLY_TERMLIST, // Get Termlist
116  REPLY_POSITIONLIST, // Get PositionList
117  REPLY_POSTLISTSTART, // Start of a postlist
118  REPLY_POSTLISTITEM, // Item in body of a postlist
119  REPLY_VALUE, // Document Value
120  REPLY_ADDDOCUMENT, // Add Document
121  REPLY_RESULTS, // Results (MSet)
122  REPLY_METADATA, // Metadata
123  REPLY_METADATAKEYLIST, // Iterator for metadata keys
124  REPLY_FREQS, // Get termfreq and collfreq
125  REPLY_UNIQUETERMS, // Get number of unique terms in doc
127 };
128 
129 #endif // XAPIAN_INCLUDED_REMOTEPROTOCOL_H
reply_type
Reply types (server -> client).
message_type
Message types (client -> server).