forked from opensearch-project/opensearch-api-specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_core.search.yaml
890 lines (890 loc) · 24.8 KB
/
_core.search.yaml
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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
openapi: 3.1.0
info:
title: Schemas of _core.search category
description: Schemas of _core.search category
version: 1.0.0
paths: {}
components:
schemas:
HitsMetadata:
type: object
properties:
total:
description: Total hit count information, present only if `track_total_hits` wasn't `false` in the search request.
oneOf:
- $ref: '#/components/schemas/TotalHits'
- type: number
hits:
type: array
items:
$ref: '#/components/schemas/Hit'
max_score:
type: ['null', number, string]
required:
- hits
TotalHits:
type: object
properties:
relation:
$ref: '#/components/schemas/TotalHitsRelation'
value:
type: number
required:
- relation
- value
TotalHitsRelation:
type: string
enum:
- eq
- gte
Hit:
type: object
properties:
_type:
$ref: '_common.yaml#/components/schemas/Type'
_index:
$ref: '_common.yaml#/components/schemas/IndexName'
_id:
$ref: '_common.yaml#/components/schemas/Id'
_score:
type: ['null', number, string]
_explanation:
$ref: '_core.explain.yaml#/components/schemas/Explanation'
fields:
type: object
additionalProperties:
type: object
highlight:
type: object
additionalProperties:
type: array
items:
type: string
inner_hits:
type: object
additionalProperties:
$ref: '#/components/schemas/InnerHitsResult'
matched_queries:
type: array
items:
type: string
_nested:
$ref: '#/components/schemas/NestedIdentity'
_ignored:
type: array
items:
type: string
ignored_field_values:
type: object
additionalProperties:
type: array
items:
type: string
_shard:
type: string
_node:
type: string
_routing:
type: string
_source:
type: object
_seq_no:
$ref: '_common.yaml#/components/schemas/SequenceNumber'
_primary_term:
type: number
_version:
$ref: '_common.yaml#/components/schemas/VersionNumber'
sort:
$ref: '_common.yaml#/components/schemas/SortResults'
required:
- _id
- _index
InnerHitsResult:
type: object
properties:
hits:
$ref: '#/components/schemas/HitsMetadata'
required:
- hits
NestedIdentity:
type: object
properties:
field:
$ref: '_common.yaml#/components/schemas/Field'
offset:
type: number
_nested:
$ref: '#/components/schemas/NestedIdentity'
required:
- field
- offset
Profile:
type: object
properties:
shards:
type: array
items:
$ref: '#/components/schemas/ShardProfile'
required:
- shards
ShardProfile:
type: object
properties:
aggregations:
type: array
items:
$ref: '#/components/schemas/AggregationProfile'
id:
type: string
searches:
type: array
items:
$ref: '#/components/schemas/SearchProfile'
fetch:
$ref: '#/components/schemas/FetchProfile'
required:
- aggregations
- id
- searches
AggregationProfile:
type: object
properties:
breakdown:
$ref: '#/components/schemas/AggregationBreakdown'
description:
type: string
time_in_nanos:
$ref: '_common.yaml#/components/schemas/DurationValueUnitNanos'
type:
type: string
debug:
$ref: '#/components/schemas/AggregationProfileDebug'
children:
type: array
items:
$ref: '#/components/schemas/AggregationProfile'
required:
- breakdown
- description
- time_in_nanos
- type
AggregationBreakdown:
type: object
properties:
build_aggregation:
type: number
build_aggregation_count:
type: number
build_leaf_collector:
type: number
build_leaf_collector_count:
type: number
collect:
type: number
collect_count:
type: number
initialize:
type: number
initialize_count:
type: number
post_collection:
type: number
post_collection_count:
type: number
reduce:
type: number
reduce_count:
type: number
required:
- build_aggregation
- build_aggregation_count
- build_leaf_collector
- build_leaf_collector_count
- collect
- collect_count
- initialize
- initialize_count
- reduce
- reduce_count
AggregationProfileDebug:
type: object
properties:
segments_with_multi_valued_ords:
type: number
collection_strategy:
type: string
segments_with_single_valued_ords:
type: number
total_buckets:
type: number
built_buckets:
type: number
result_strategy:
type: string
has_filter:
type: boolean
delegate:
type: string
delegate_debug:
$ref: '#/components/schemas/AggregationProfileDebug'
chars_fetched:
type: number
extract_count:
type: number
extract_ns:
type: number
values_fetched:
type: number
collect_analyzed_ns:
type: number
collect_analyzed_count:
type: number
surviving_buckets:
type: number
ordinals_collectors_used:
type: number
ordinals_collectors_overhead_too_high:
type: number
string_hashing_collectors_used:
type: number
numeric_collectors_used:
type: number
empty_collectors_used:
type: number
deferred_aggregators:
type: array
items:
type: string
segments_with_doc_count_field:
type: number
segments_with_deleted_docs:
type: number
filters:
type: array
items:
$ref: '#/components/schemas/AggregationProfileDelegateDebugFilter'
segments_counted:
type: number
segments_collected:
type: number
map_reducer:
type: string
AggregationProfileDelegateDebugFilter:
type: object
properties:
results_from_metadata:
type: number
query:
type: string
specialized_for:
type: string
segments_counted_in_constant_time:
type: number
SearchProfile:
type: object
properties:
collector:
type: array
items:
$ref: '#/components/schemas/Collector'
query:
type: array
items:
$ref: '#/components/schemas/QueryProfile'
rewrite_time:
type: number
required:
- collector
- query
- rewrite_time
Collector:
type: object
properties:
name:
type: string
reason:
type: string
time_in_nanos:
$ref: '_common.yaml#/components/schemas/DurationValueUnitNanos'
children:
type: array
items:
$ref: '#/components/schemas/Collector'
required:
- name
- reason
- time_in_nanos
QueryProfile:
type: object
properties:
breakdown:
$ref: '#/components/schemas/QueryBreakdown'
description:
type: string
time_in_nanos:
$ref: '_common.yaml#/components/schemas/DurationValueUnitNanos'
type:
type: string
children:
type: array
items:
$ref: '#/components/schemas/QueryProfile'
required:
- breakdown
- description
- time_in_nanos
- type
QueryBreakdown:
type: object
properties:
advance:
type: number
advance_count:
type: number
build_scorer:
type: number
build_scorer_count:
type: number
create_weight:
type: number
create_weight_count:
type: number
match:
type: number
match_count:
type: number
shallow_advance:
type: number
shallow_advance_count:
type: number
next_doc:
type: number
next_doc_count:
type: number
score:
type: number
score_count:
type: number
compute_max_score:
type: number
compute_max_score_count:
type: number
set_min_competitive_score:
type: number
set_min_competitive_score_count:
type: number
required:
- advance
- advance_count
- build_scorer
- build_scorer_count
- compute_max_score
- compute_max_score_count
- create_weight
- create_weight_count
- match
- match_count
- next_doc
- next_doc_count
- score
- score_count
- set_min_competitive_score
- set_min_competitive_score_count
- shallow_advance
- shallow_advance_count
FetchProfile:
type: object
properties:
type:
type: string
description:
type: string
time_in_nanos:
$ref: '_common.yaml#/components/schemas/DurationValueUnitNanos'
breakdown:
$ref: '#/components/schemas/FetchProfileBreakdown'
debug:
$ref: '#/components/schemas/FetchProfileDebug'
children:
type: array
items:
$ref: '#/components/schemas/FetchProfile'
required:
- breakdown
- description
- time_in_nanos
- type
FetchProfileBreakdown:
type: object
properties:
load_source:
type: number
load_source_count:
type: number
load_stored_fields:
type: number
load_stored_fields_count:
type: number
next_reader:
type: number
next_reader_count:
type: number
process_count:
type: number
process:
type: number
FetchProfileDebug:
type: object
properties:
stored_fields:
type: array
items:
type: string
fast_path:
type: number
Suggest:
oneOf:
- $ref: '#/components/schemas/CompletionSuggest'
- $ref: '#/components/schemas/PhraseSuggest'
- $ref: '#/components/schemas/TermSuggest'
CompletionSuggest:
allOf:
- $ref: '#/components/schemas/SuggestBase'
- type: object
properties:
options:
oneOf:
- $ref: '#/components/schemas/CompletionSuggestOption'
- type: array
items:
$ref: '#/components/schemas/CompletionSuggestOption'
required:
- options
CompletionSuggestOption:
type: object
properties:
collate_match:
type: boolean
contexts:
type: object
additionalProperties:
type: array
items:
$ref: '#/components/schemas/Context'
fields:
type: object
additionalProperties:
type: object
_id:
type: string
_index:
$ref: '_common.yaml#/components/schemas/IndexName'
_routing:
$ref: '_common.yaml#/components/schemas/Routing'
_score:
type: number
_source:
type: object
text:
type: string
score:
type: number
required:
- text
Context:
description: Text or location that we want similar documents for or a lookup to a document's field for the text.
oneOf:
- type: string
- $ref: '_common.yaml#/components/schemas/GeoLocation'
SuggestBase:
type: object
properties:
length:
type: number
offset:
type: number
text:
type: string
required:
- length
- offset
- text
PhraseSuggest:
allOf:
- $ref: '#/components/schemas/SuggestBase'
- type: object
properties:
options:
oneOf:
- $ref: '#/components/schemas/PhraseSuggestOption'
- type: array
items:
$ref: '#/components/schemas/PhraseSuggestOption'
required:
- options
PhraseSuggestOption:
type: object
properties:
text:
type: string
score:
type: number
highlighted:
type: string
collate_match:
type: boolean
required:
- score
- text
TermSuggest:
allOf:
- $ref: '#/components/schemas/SuggestBase'
- type: object
properties:
options:
oneOf:
- $ref: '#/components/schemas/TermSuggestOption'
- type: array
items:
$ref: '#/components/schemas/TermSuggestOption'
required:
- options
TermSuggestOption:
type: object
properties:
text:
type: string
score:
type: number
freq:
type: number
highlighted:
type: string
collate_match:
type: boolean
required:
- freq
- score
- text
TrackHits:
description: |-
Number of hits matching the query to count accurately. If true, the exact
number of hits is returned at the cost of some performance. If false, the
response does not include the total number of hits matching the query.
Defaults to 10,000 hits.
oneOf:
- type: boolean
- type: number
SourceConfigParam:
description: |-
Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.
Used as a query parameter along with the `_source_includes` and `_source_excludes` parameters.
oneOf:
- type: boolean
- $ref: '_common.yaml#/components/schemas/Fields'
InnerHits:
type: object
properties:
name:
$ref: '_common.yaml#/components/schemas/Name'
size:
description: The maximum number of hits to return per `inner_hits`.
type: number
from:
description: Inner hit starting document offset.
type: number
collapse:
$ref: '#/components/schemas/FieldCollapse'
docvalue_fields:
type: array
items:
$ref: '_common.query_dsl.yaml#/components/schemas/FieldAndFormat'
explain:
type: boolean
highlight:
$ref: '#/components/schemas/Highlight'
ignore_unmapped:
type: boolean
script_fields:
type: object
additionalProperties:
$ref: '_common.yaml#/components/schemas/ScriptField'
seq_no_primary_term:
type: boolean
fields:
$ref: '_common.yaml#/components/schemas/Fields'
sort:
$ref: '_common.yaml#/components/schemas/Sort'
_source:
$ref: '#/components/schemas/SourceConfig'
stored_field:
$ref: '_common.yaml#/components/schemas/Fields'
track_scores:
type: boolean
version:
type: boolean
FieldCollapse:
type: object
properties:
field:
$ref: '_common.yaml#/components/schemas/Field'
inner_hits:
description: The number of inner hits and their sort order
oneOf:
- $ref: '#/components/schemas/InnerHits'
- type: array
items:
$ref: '#/components/schemas/InnerHits'
max_concurrent_group_searches:
description: The number of concurrent requests allowed to retrieve the inner_hits per group
type: number
collapse:
$ref: '#/components/schemas/FieldCollapse'
required:
- field
Highlight:
allOf:
- $ref: '#/components/schemas/HighlightBase'
- type: object
properties:
encoder:
$ref: '#/components/schemas/HighlighterEncoder'
fields:
type: object
additionalProperties:
$ref: '#/components/schemas/HighlightField'
required:
- fields
HighlighterEncoder:
type: string
enum:
- default
- html
HighlightField:
allOf:
- $ref: '#/components/schemas/HighlightBase'
- type: object
properties:
fragment_offset:
type: number
matched_fields:
$ref: '_common.yaml#/components/schemas/Fields'
analyzer:
$ref: '_common.analysis.yaml#/components/schemas/Analyzer'
HighlightBase:
type: object
properties:
type:
$ref: '#/components/schemas/HighlighterType'
boundary_chars:
description: A string that contains each boundary character.
type: string
boundary_max_scan:
description: How far to scan for boundary characters.
type: number
boundary_scanner:
$ref: '#/components/schemas/BoundaryScanner'
boundary_scanner_locale:
description: |-
Controls which locale is used to search for sentence and word boundaries.
This parameter takes a form of a language tag, for example: `"en-US"`, `"fr-FR"`, `"ja-JP"`.
type: string
force_source:
deprecated: true
type: boolean
fragmenter:
$ref: '#/components/schemas/HighlighterFragmenter'
fragment_size:
description: The size of the highlighted fragment in characters.
type: number
highlight_filter:
type: boolean
highlight_query:
$ref: '_common.query_dsl.yaml#/components/schemas/QueryContainer'
max_fragment_length:
type: number
max_analyzed_offset:
description: |-
If set to a non-negative value, highlighting stops at this defined maximum limit.
The rest of the text is not processed, thus not highlighted and no error is returned
The `max_analyzed_offset` query setting does not override the `index.highlight.max_analyzed_offset` setting, which prevails when it's set to lower value than the query setting.
type: number
no_match_size:
description: The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.
type: number
number_of_fragments:
description: |-
The maximum number of fragments to return.
If the number of fragments is set to `0`, no fragments are returned.
Instead, the entire field contents are highlighted and returned.
This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required.
If `number_of_fragments` is `0`, `fragment_size` is ignored.
type: number
options:
type: object
additionalProperties:
type: object
order:
$ref: '#/components/schemas/HighlighterOrder'
phrase_limit:
description: |-
Controls the number of matching phrases in a document that are considered.
Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory.
When using `matched_fields`, `phrase_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory.
Only supported by the `fvh` highlighter.
type: number
post_tags:
description: |-
Use in conjunction with `pre_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `<em>` and `</em>` tags.
type: array
items:
type: string
pre_tags:
description: |-
Use in conjunction with `post_tags` to define the HTML tags to use for the highlighted text.
By default, highlighted text is wrapped in `<em>` and `</em>` tags.
type: array
items:
type: string
require_field_match:
description: |-
By default, only fields that contains a query match are highlighted.
Set to `false` to highlight all fields.
type: boolean
tags_schema:
$ref: '#/components/schemas/HighlighterTagsSchema'
HighlighterType:
type: string
enum:
- fvh
- plain
- unified
BoundaryScanner:
type: string
enum:
- chars
- sentence
- word
HighlighterFragmenter:
type: string
enum:
- simple
- span
HighlighterOrder:
type: string
enum:
- score
HighlighterTagsSchema:
type: string
enum:
- styled
SourceConfig:
description: Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.
oneOf:
- type: boolean
- type: array
items:
$ref: '_common.yaml#/components/schemas/Field'
- $ref: '#/components/schemas/SourceFilter'
SourceFilter:
type: object
properties:
excludes:
$ref: '_common.yaml#/components/schemas/Fields'
includes:
$ref: '_common.yaml#/components/schemas/Fields'
Rescore:
type: object
properties:
query:
$ref: '#/components/schemas/RescoreQuery'
window_size:
type: number
required:
- query
RescoreQuery:
type: object
properties:
rescore_query:
$ref: '_common.query_dsl.yaml#/components/schemas/QueryContainer'
query_weight:
description: Relative importance of the original query versus the rescore query.
type: number
rescore_query_weight:
description: Relative importance of the rescore query versus the original query.
type: number
score_mode:
$ref: '#/components/schemas/ScoreMode'
required:
- rescore_query
ScoreMode:
type: string
enum:
- avg
- max
- min
- multiply
- total
Suggester:
type: object
properties:
text:
description: Global suggest text, to avoid repetition when the same text is used in several suggesters
type: string
PointInTimeReference:
type: object
properties:
id:
$ref: '_common.yaml#/components/schemas/Id'
keep_alive:
$ref: '_common.yaml#/components/schemas/Duration'
required:
- id
ResponseBody:
type: object
properties:
took:
type: number
timed_out:
type: boolean
_shards:
$ref: '_common.yaml#/components/schemas/ShardStatistics'
phase_took:
x-version-added: '2.12'
$ref: '_common.yaml#/components/schemas/PhaseTook'
hits:
$ref: '#/components/schemas/HitsMetadata'
aggregations:
type: object
additionalProperties:
$ref: '_common.aggregations.yaml#/components/schemas/Aggregate'
_clusters:
$ref: '_common.yaml#/components/schemas/ClusterStatistics'
fields:
type: object
additionalProperties:
type: object
max_score:
type: number
num_reduce_phases:
type: number
profile:
$ref: '#/components/schemas/Profile'
pit_id:
$ref: '_common.yaml#/components/schemas/Id'
_scroll_id:
$ref: '_common.yaml#/components/schemas/ScrollId'
suggest:
type: object
additionalProperties:
type: array
items:
$ref: '#/components/schemas/Suggest'
terminated_early:
type: boolean
required:
- _shards
- hits
- timed_out
- took