Skip to content

Commit

Permalink
Add REST API spec for /_search_shards endpoint
Browse files Browse the repository at this point in the history
Also adds REST test for /_search_shards

Closes elastic#5907
  • Loading branch information
dakrone committed Apr 23, 2014
1 parent 0daaddf commit c7a5f3f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
51 changes: 51 additions & 0 deletions rest-api-spec/api/search_shards.json
@@ -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
@@ -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 }

0 comments on commit c7a5f3f

Please sign in to comment.