OpenSearch/rest-api-spec/api/search_exists.json
Areek Zillur 1d581e6286 Search Exists API: Checks if any matching documents exist for a given query
Implements a new Exists API allowing users to do fast exists check on any matched documents for a given query.
This API should be faster then using the Count API as it will:
 - early terminate the search execution once any document is found to exist
 - return the response as soon as the first shard reports matched documents

closes #6995
2014-07-31 15:42:30 -04:00

56 lines
2.0 KiB
JSON

{
"search_exists": {
"documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/exists.html",
"methods": ["POST", "GET"],
"url": {
"path": "/_search/exists",
"paths": ["/_search/exists", "/{index}/_search/exists", "/{index}/{type}/_search/exists"],
"parts": {
"index": {
"type" : "list",
"description" : "A comma-separated list of indices to restrict the results"
},
"type": {
"type" : "list",
"description" : "A comma-separated list of types to restrict the results"
}
},
"params": {
"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."
},
"min_score": {
"type" : "number",
"description" : "Include only documents with a specific `_score` value in the result"
},
"preference": {
"type" : "string",
"description" : "Specify the node or shard the operation should be performed on (default: random)"
},
"routing": {
"type" : "string",
"description" : "Specific routing value"
},
"source": {
"type" : "string",
"description" : "The URL-encoded query definition (instead of using the request body)"
}
}
},
"body": {
"description" : "A query to restrict the results specified with the Query DSL (optional)"
}
}
}