aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/google.golang.org/appengine/internal/search/search.proto
blob: 61df6508b1e21b789fefa3257ad547875e4aa8c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
syntax = "proto2";
option go_package = "search";

package search;

message Scope {
  enum Type {
    USER_BY_CANONICAL_ID = 1;
    USER_BY_EMAIL = 2;
    GROUP_BY_CANONICAL_ID = 3;
    GROUP_BY_EMAIL = 4;
    GROUP_BY_DOMAIN = 5;
    ALL_USERS = 6;
    ALL_AUTHENTICATED_USERS = 7;
  }

  optional Type type = 1;
  optional string value = 2;
}

message Entry {
  enum Permission {
    READ = 1;
    WRITE = 2;
    FULL_CONTROL = 3;
  }

  optional Scope scope = 1;
  optional Permission permission = 2;
  optional string display_name = 3;
}

message AccessControlList {
  optional string owner = 1;
  repeated Entry entries = 2;
}

message FieldValue {
  enum ContentType {
    TEXT = 0;
    HTML = 1;
    ATOM = 2;
    DATE = 3;
    NUMBER = 4;
    GEO = 5;
  }

  optional ContentType type = 1 [default = TEXT];

  optional string language = 2 [default = "en"];

  optional string string_value = 3;

  optional group Geo = 4 {
    required double lat = 5;
    required double lng = 6;
  }
}

message Field {
  required string name = 1;
  required FieldValue value = 2;
}

message FieldTypes {
  required string name = 1;
  repeated FieldValue.ContentType type = 2;
}

message IndexShardSettings {
  repeated int32 prev_num_shards = 1;
  required int32 num_shards = 2 [default=1];
  repeated int32 prev_num_shards_search_false = 3;
  optional string local_replica = 4 [default = ""];
}

message FacetValue {
  enum ContentType {
    ATOM = 2;
    NUMBER = 4;
  }

  optional ContentType type = 1 [default = ATOM];
  optional string string_value = 3;
}

message Facet {
  required string name = 1;
  required FacetValue value = 2;
}

message DocumentMetadata  {
  optional int64 version = 1;
  optional int64 committed_st_version = 2;
}

message Document {
  optional string id = 1;
  optional string language = 2 [default = "en"];
  repeated Field field = 3;
  optional int32 order_id = 4;
  optional OrderIdSource order_id_source = 6 [default = SUPPLIED];

  enum OrderIdSource {
    DEFAULTED = 0;
    SUPPLIED = 1;
  }

  enum Storage {
    DISK = 0;
  }

  optional Storage storage = 5 [default = DISK];
  repeated Facet facet = 8;
}

message SearchServiceError {
  enum ErrorCode {
    OK = 0;
    INVALID_REQUEST = 1;
    TRANSIENT_ERROR = 2;
    INTERNAL_ERROR = 3;
    PERMISSION_DENIED = 4;
    TIMEOUT = 5;
    CONCURRENT_TRANSACTION = 6;
  }
}

message RequestStatus {
  required SearchServiceError.ErrorCode code = 1;
  optional string error_detail = 2;
  optional int32 canonical_code = 3;
}

message IndexSpec {
  required string name = 1;

  enum Consistency {
    GLOBAL = 0;
    PER_DOCUMENT = 1;
  }
  optional Consistency consistency = 2 [default = PER_DOCUMENT];

  optional string namespace = 3;
  optional int32 version = 4;

  enum Source {
    SEARCH = 0;
    DATASTORE = 1;
    CLOUD_STORAGE = 2;
  }
  optional Source source = 5 [default = SEARCH];

  enum Mode {
    PRIORITY = 0;
    BACKGROUND = 1;
  }
  optional Mode mode = 6 [default = PRIORITY];
}

message IndexMetadata {
  required IndexSpec index_spec = 1;

  repeated FieldTypes field = 2;

  message Storage {
    optional int64 amount_used = 1;
    optional int64 limit = 2;
  }
  optional Storage storage = 3;
}

message IndexDocumentParams {
  repeated Document document = 1;

  enum Freshness {
    SYNCHRONOUSLY = 0;
    WHEN_CONVENIENT = 1;
  }
  optional Freshness freshness = 2 [default = SYNCHRONOUSLY, deprecated=true];

  required IndexSpec index_spec = 3;
}

message IndexDocumentRequest {
  required IndexDocumentParams params = 1;

  optional bytes app_id = 3;
}

message IndexDocumentResponse {
  repeated RequestStatus status = 1;

  repeated string doc_id = 2;
}

message DeleteDocumentParams {
  repeated string doc_id = 1;

  required IndexSpec index_spec = 2;
}

message DeleteDocumentRequest {
  required DeleteDocumentParams params = 1;

  optional bytes app_id = 3;
}

message DeleteDocumentResponse {
  repeated RequestStatus status = 1;
}

message ListDocumentsParams {
  required IndexSpec index_spec = 1;
  optional string start_doc_id = 2;
  optional bool include_start_doc = 3 [default = true];
  optional int32 limit = 4 [default = 100];
  optional bool keys_only = 5;
}

message ListDocumentsRequest {
  required ListDocumentsParams params = 1;

  optional bytes app_id = 2;
}

message ListDocumentsResponse {
  required RequestStatus status = 1;

  repeated Document document = 2;
}

message ListIndexesParams {
  optional bool fetch_schema = 1;
  optional int32 limit = 2 [default = 20];
  optional string namespace = 3;
  optional string start_index_name = 4;
  optional bool include_start_index = 5 [default = true];
  optional string index_name_prefix = 6;
  optional int32 offset = 7;
  optional IndexSpec.Source source = 8 [default = SEARCH];
}

message ListIndexesRequest {
  required ListIndexesParams params = 1;

  optional bytes app_id = 3;
}

message ListIndexesResponse {
  required RequestStatus status = 1;
  repeated IndexMetadata index_metadata = 2;
}

message DeleteSchemaParams {
  optional IndexSpec.Source source = 1 [default = SEARCH];
  repeated IndexSpec index_spec = 2;
}

message DeleteSchemaRequest {
  required DeleteSchemaParams params = 1;

  optional bytes app_id = 3;
}

message DeleteSchemaResponse {
  repeated RequestStatus status = 1;
}

message SortSpec {
  required string sort_expression = 1;
  optional bool sort_descending = 2 [default = true];
  optional string default_value_text = 4;
  optional double default_value_numeric = 5;
}

message ScorerSpec {
  enum Scorer {
    RESCORING_MATCH_SCORER = 0;
    MATCH_SCORER = 2;
  }
  optional Scorer scorer = 1 [default = MATCH_SCORER];

  optional int32 limit = 2 [default = 1000];
  optional string match_scorer_parameters = 9;
}

message FieldSpec {
  repeated string name = 1;

  repeated group Expression = 2 {
    required string name = 3;
    required string expression = 4;
  }
}

message FacetRange {
  optional string name = 1;
  optional string start = 2;
  optional string end = 3;
}

message FacetRequestParam {
  optional int32 value_limit = 1;
  repeated FacetRange range = 2;
  repeated string value_constraint = 3;
}

message FacetAutoDetectParam {
  optional int32 value_limit = 1 [default = 10];
}

message FacetRequest {
  required string name = 1;
  optional FacetRequestParam params = 2;
}

message FacetRefinement {
  required string name = 1;
  optional string value = 2;

  message Range {
    optional string start = 1;
    optional string end = 2;
  }
  optional Range range = 3;
}

message SearchParams {
  required IndexSpec index_spec = 1;
  required string query = 2;
  optional string cursor = 4;
  optional int32 offset = 11;

  enum CursorType {
    NONE = 0;
    SINGLE = 1;
    PER_RESULT = 2;
  }
  optional CursorType cursor_type = 5 [default = NONE];

  optional int32 limit = 6 [default = 20];
  optional int32 matched_count_accuracy = 7;
  repeated SortSpec sort_spec = 8;
  optional ScorerSpec scorer_spec = 9;
  optional FieldSpec field_spec = 10;
  optional bool keys_only = 12;

  enum ParsingMode {
    STRICT = 0;
    RELAXED = 1;
  }
  optional ParsingMode parsing_mode = 13 [default = STRICT];

  optional int32 auto_discover_facet_count = 15 [default = 0];
  repeated FacetRequest include_facet = 16;
  repeated FacetRefinement facet_refinement = 17;
  optional FacetAutoDetectParam facet_auto_detect_param = 18;
  optional int32 facet_depth = 19 [default=1000];
}

message SearchRequest {
  required SearchParams params = 1;

  optional bytes app_id = 3;
}

message FacetResultValue {
  required string name = 1;
  required int32 count = 2;
  required FacetRefinement refinement = 3;
}

message FacetResult {
  required string name = 1;
  repeated FacetResultValue value = 2;
}

message SearchResult {
  required Document document = 1;
  repeated Field expression = 4;
  repeated double score = 2;
  optional string cursor = 3;
}

message SearchResponse {
  repeated SearchResult result = 1;
  required int64 matched_count = 2;
  required RequestStatus status = 3;
  optional string cursor = 4;
  repeated FacetResult facet_result = 5;

  extensions 1000 to 9999;
}