IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
URI Search
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
URI Search
editSpecifies search criteria as query parameters in the request URI.
GET twitter/_search?q=user:kimchy
Request
editGET /<index>/_search?q=<parameter>
Description
editYou can use query parameters to define your search criteria directly in the request URI, rather than in the request body. Request URI searches do not support the full Elasticsearch Query DSL, but are handy for testing.
Path parameters
edit-
<index>
- (Optional, string) Comma-separated list or wildcard expression of index names used to limit the request.
Query parameters
editSee the search API’s query parameters.
Examples
editGET twitter/_search?q=user:kimchy
The API returns the following response:
{ "timed_out": false, "took": 62, "_shards":{ "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits":{ "total" : { "value": 1, "relation": "eq" }, "max_score": 1.3862942, "hits" : [ { "_index" : "twitter", "_type" : "_doc", "_id" : "0", "_score": 1.3862942, "_source" : { "user" : "kimchy", "date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch", "likes": 0 } } ] } }
Was this helpful?
Thank you for your feedback.