The search API and URI search pages document the same `_search` API. This combines the documentation from each page under the search API docs.
This commit is contained in:
parent
1aea9d5f49
commit
ab8ae7cf25
|
@ -723,6 +723,11 @@ See <<ilm-actions>>.
|
|||
|
||||
See <<ilm-index-lifecycle>>.
|
||||
|
||||
[role="exclude",id="search-uri-request"]
|
||||
=== URI Search
|
||||
|
||||
See <<search-search>>.
|
||||
|
||||
[role="exclude",id="modules-gateway-dangling-indices"]
|
||||
=== Dangling indices
|
||||
|
||||
|
|
|
@ -152,8 +152,6 @@ high). This default value is `5`.
|
|||
|
||||
include::search/search.asciidoc[]
|
||||
|
||||
include::search/uri-request.asciidoc[]
|
||||
|
||||
include::search/request-body.asciidoc[]
|
||||
|
||||
include::search/async-search.asciidoc[]
|
||||
|
|
|
@ -1,85 +0,0 @@
|
|||
[[search-uri-request]]
|
||||
=== URI Search
|
||||
|
||||
Specifies search criteria as query parameters in the request URI.
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
GET twitter/_search?q=user:kimchy
|
||||
--------------------------------------------------
|
||||
// TEST[setup:twitter]
|
||||
|
||||
|
||||
[[search-uri-request-api-request]]
|
||||
==== {api-request-title}
|
||||
|
||||
`GET /<index>/_search?q=<parameter>`
|
||||
|
||||
|
||||
[[search-uri-request-api-desc]]
|
||||
==== {api-description-title}
|
||||
|
||||
You 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 {es} Query DSL, but are handy for testing.
|
||||
|
||||
|
||||
[[search-uri-request-api-path-params]]
|
||||
==== {api-path-parms-title}
|
||||
|
||||
include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
|
||||
|
||||
|
||||
[[search-uri-request-api-query-params]]
|
||||
==== {api-query-parms-title}
|
||||
|
||||
See the <<search-search-api-query-params,search API's query parameters>>.
|
||||
|
||||
|
||||
[[search-uri-request-api-example]]
|
||||
==== {api-examples-title}
|
||||
|
||||
[source,console]
|
||||
--------------------------------------------------
|
||||
GET twitter/_search?q=user:kimchy
|
||||
--------------------------------------------------
|
||||
// TEST[setup:twitter]
|
||||
|
||||
|
||||
The API returns the following response:
|
||||
|
||||
[source,console-result]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// TESTRESPONSE[s/"took": 62/"took": "$body.took"/]
|
Loading…
Reference in New Issue