forked from elastic/elasticsearch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add REST API spec for /_search_shards endpoint
Also adds REST test for /_search_shards Closes elastic#5907
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"search_shards": { | ||
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-shards.html", | ||
"methods": ["GET", "POST"], | ||
"url": { | ||
"path": "/{index}/{type}/_search_shards", | ||
"paths": ["/_search_shards", "/{index}/_search_shards", "/{index}/{type}/_search_shards"], | ||
"parts": { | ||
"index": { | ||
"type" : "string", | ||
"required" : false, | ||
"description" : "The name of the index" | ||
}, | ||
"type": { | ||
"type" : "string", | ||
"required" : false, | ||
"description" : "The type of the document" | ||
} | ||
}, | ||
"params": { | ||
"preference": { | ||
"type" : "string", | ||
"description" : "Specify the node or shard the operation should be performed on (default: random)" | ||
}, | ||
"routing": { | ||
"type" : "string", | ||
"description" : "Specific routing value" | ||
}, | ||
"local": { | ||
"type": "boolean", | ||
"description": "Return local information, do not retrieve the state from master node (default: false)" | ||
}, | ||
"ignore_unavailable": { | ||
"type" : "boolean", | ||
"description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" | ||
}, | ||
"allow_no_indices": { | ||
"type" : "boolean", | ||
"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)" | ||
}, | ||
"expand_wildcards": { | ||
"type" : "enum", | ||
"options" : ["open","closed"], | ||
"default" : "open", | ||
"description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." | ||
} | ||
} | ||
}, | ||
"body": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"Basic /_search_shards test": | ||
- do: | ||
indices.create: | ||
index: test_1 | ||
|
||
- do: | ||
cluster.health: | ||
wait_for_status: yellow | ||
|
||
- do: | ||
search_shards: | ||
index: test_1 | ||
routing: foo | ||
|
||
- match: { shards.0.0.index: test_1 } |