Skip to content

Commit 6543e50

Browse files
authored
Fix msearch rest-api-spec (#130627)
* Fix msearch rest-api-spec * Add YAML tests for added parameters
1 parent f5c6b35 commit 6543e50

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,38 @@
6969
"type":"boolean",
7070
"description":"Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution",
7171
"default":"true"
72+
},
73+
"index":{
74+
"type":"list",
75+
"description":"A comma-separated list of index names to use as default"
76+
},
77+
"ignore_unavailable":{
78+
"type":"boolean",
79+
"description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)"
80+
},
81+
"ignore_throttled":{
82+
"type":"boolean",
83+
"description":"Whether specified concrete, expanded or aliased indices should be ignored when throttled",
84+
"deprecated":true
85+
},
86+
"allow_no_indices":{
87+
"type":"boolean",
88+
"description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)"
89+
},
90+
"expand_wildcards":{
91+
"type":"enum",
92+
"options": ["open", "closed", "hidden", "none", "all"],
93+
"default":"open",
94+
"description":"Whether to expand wildcard expression to concrete indices that are open, closed or both."
95+
},
96+
"routing":{
97+
"type":"list",
98+
"description":"A comma-separated list of specific routing values"
99+
},
100+
"include_named_queries_score":{
101+
"type":"boolean",
102+
"description":"Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false)",
103+
"default": false
72104
}
73105
},
74106
"body":{

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/msearch/10_basic.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
setup:
3+
- requires:
4+
test_runner_features: allowed_warnings
35

46
- do:
57
index:
@@ -67,6 +69,12 @@ setup:
6769
rest_total_hits_as_int: true
6870
max_concurrent_shard_requests: 1
6971
max_concurrent_searches: 1
72+
ignore_unavailable: false
73+
ignore_throttled: false
74+
allow_no_indices: false
75+
expand_wildcards: open
76+
include_named_queries_score: false
77+
index: index_*
7078
body:
7179
- index: index_*
7280
- query:
@@ -83,6 +91,8 @@ setup:
8391
- {}
8492
- query:
8593
match_all: {}
94+
allowed_warnings:
95+
- "[ignore_throttled] parameter is deprecated because frozen indices have been deprecated. Consider cold or frozen tiers in place of frozen indices."
8696

8797
- match: { responses.0.hits.total: 2 }
8898
- match: { responses.1.hits.total: 1 }
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
setup:
3+
- do:
4+
index:
5+
index: index_1
6+
routing: "1"
7+
id: "1"
8+
body: { foo: bar }
9+
10+
- do:
11+
indices.refresh: {}
12+
13+
---
14+
"Routing":
15+
16+
- do:
17+
msearch:
18+
rest_total_hits_as_int: true
19+
routing: "1"
20+
body:
21+
- {}
22+
- query:
23+
match_all: {}
24+
25+
- match: { responses.0.hits.total: 1 }

0 commit comments

Comments
 (0)