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