xapian-core
1.4.26
net
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
61
enum
message_type
{
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
98
MSG_MAX
99
};
100
102
enum
reply_type
{
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
126
REPLY_MAX
127
};
128
129
#endif // XAPIAN_INCLUDED_REMOTEPROTOCOL_H
MSG_COLLFREQ
Definition:
remoteprotocol.h:63
MSG_DELETEDOCUMENTTERM
Definition:
remoteprotocol.h:93
MSG_GETMETADATA
Definition:
remoteprotocol.h:84
MSG_DOCLENGTH
Definition:
remoteprotocol.h:69
MSG_COMMIT
Definition:
remoteprotocol.h:79
MSG_UNIQUETERMS
Definition:
remoteprotocol.h:92
REPLY_POSTLISTITEM
Definition:
remoteprotocol.h:118
REPLY_TERMFREQ
Definition:
remoteprotocol.h:111
REPLY_VALUE
Definition:
remoteprotocol.h:119
MSG_TERMEXISTS
Definition:
remoteprotocol.h:65
REPLY_POSITIONLIST
Definition:
remoteprotocol.h:116
REPLY_TERMDOESNTEXIST
Definition:
remoteprotocol.h:109
MSG_DELETEDOCUMENTTERM_
Definition:
remoteprotocol.h:78
REPLY_ALLTERMS
Definition:
remoteprotocol.h:106
reply_type
reply_type
Reply types (server -> client).
Definition:
remoteprotocol.h:102
REPLY_DOCLENGTH
Definition:
remoteprotocol.h:113
MSG_QUERY
Definition:
remoteprotocol.h:70
MSG_ADDSPELLING
Definition:
remoteprotocol.h:97
MSG_ADDDOCUMENT
Definition:
remoteprotocol.h:76
MSG_REOPEN
Definition:
remoteprotocol.h:74
MSG_CANCEL_
Definition:
remoteprotocol.h:77
MSG_ALLTERMS
Definition:
remoteprotocol.h:62
REPLY_MAX
Definition:
remoteprotocol.h:126
MSG_TERMLIST
Definition:
remoteprotocol.h:71
REPLY_VALUESTATS
Definition:
remoteprotocol.h:112
MSG_VALUESTATS
Definition:
remoteprotocol.h:67
MSG_GETMSET
Definition:
remoteprotocol.h:88
REPLY_METADATA
Definition:
remoteprotocol.h:122
REPLY_POSTLISTSTART
Definition:
remoteprotocol.h:117
REPLY_DOCDATA
Definition:
remoteprotocol.h:108
REPLY_UNIQUETERMS
Definition:
remoteprotocol.h:125
REPLY_TERMLIST
Definition:
remoteprotocol.h:115
MSG_SHUTDOWN
Definition:
remoteprotocol.h:89
REPLY_UPDATE
Definition:
remoteprotocol.h:103
MSG_REPLACEDOCUMENT_
Definition:
remoteprotocol.h:80
MSG_POSITIONLIST
Definition:
remoteprotocol.h:72
MSG_SETMETADATA_
Definition:
remoteprotocol.h:85
MSG_SETMETADATA
Definition:
remoteprotocol.h:96
MSG_MAX
Definition:
remoteprotocol.h:98
MSG_CANCEL
Definition:
remoteprotocol.h:95
MSG_REPLACEDOCUMENT
Definition:
remoteprotocol.h:94
REPLY_COLLFREQ
Definition:
remoteprotocol.h:107
message_type
message_type
Message types (client -> server).
Definition:
remoteprotocol.h:61
MSG_REMOVESPELLING
Definition:
remoteprotocol.h:87
MSG_KEEPALIVE
Definition:
remoteprotocol.h:68
REPLY_TERMEXISTS
Definition:
remoteprotocol.h:110
MSG_METADATAKEYLIST
Definition:
remoteprotocol.h:90
MSG_ADDSPELLING_
Definition:
remoteprotocol.h:86
MSG_FREQS
Definition:
remoteprotocol.h:91
MSG_DOCUMENT
Definition:
remoteprotocol.h:64
REPLY_RESULTS
Definition:
remoteprotocol.h:121
REPLY_DONE
Definition:
remoteprotocol.h:105
REPLY_EXCEPTION
Definition:
remoteprotocol.h:104
MSG_UPDATE
Definition:
remoteprotocol.h:75
REPLY_STATS
Definition:
remoteprotocol.h:114
REPLY_METADATAKEYLIST
Definition:
remoteprotocol.h:123
MSG_WRITEACCESS
Definition:
remoteprotocol.h:83
MSG_REPLACEDOCUMENTTERM
Definition:
remoteprotocol.h:81
MSG_POSTLIST
Definition:
remoteprotocol.h:73
MSG_TERMFREQ
Definition:
remoteprotocol.h:66
REPLY_FREQS
Definition:
remoteprotocol.h:124
REPLY_ADDDOCUMENT
Definition:
remoteprotocol.h:120
MSG_DELETEDOCUMENT
Definition:
remoteprotocol.h:82
Generated by
Doxygen 1.8.13