Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add REST API spec for /_search_shards endpoint #5907

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions rest-api-spec/api/search_shards.json
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
}
}
16 changes: 16 additions & 0 deletions rest-api-spec/test/search_shards/10_basic.yaml
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 }