Skip to content

Commit

Permalink
[DOCS] Remove search request body page (elastic#60972) (elastic#60978)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodewig authored Aug 11, 2020
1 parent f2733bc commit a479a2a
Show file tree
Hide file tree
Showing 16 changed files with 135 additions and 241 deletions.
2 changes: 1 addition & 1 deletion docs/java-rest/high-level/document/multi-get.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ include-tagged::{doc-tests-file}[{api}-request-item-extras]
<2> Version
<3> Version type

{ref}/search-request-body.html#request-body-search-preference[`preference`],
{ref}/search-your-data.html#search-preference[`preference`],
{ref}/docs-get.html#realtime[`realtime`]
and
{ref}/docs-get.html#get-refresh[`refresh`] can be set on the main request but
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/how-to/recipes/scoring.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ are different too.

The recommended way to work around this issue is to use a string that identifies
the user that is logged is (a user id or session id for instance) as a
<<request-body-search-preference,preference>>. This ensures that all queries of a
<<search-preference,preference>>. This ensures that all queries of a
given user are always going to hit the same shards, so scores remain more
consistent across queries.

Expand Down
59 changes: 41 additions & 18 deletions docs/reference/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ See <<highlighting>>.

[role="exclude",id="search-request-index-boost"]
=== Index boost parameter for request body search API
See <<request-body-search-index-boost>>.
See <<index-boost>>.

[role="exclude",id="search-request-inner-hits"]
=== Inner hits parameter for request body search API
Expand All @@ -95,15 +95,15 @@ See <<post-filter>>.

[role="exclude",id="search-request-preference"]
=== Preference parameter for request body search API
See <<request-body-search-preference>>.
See <<search-preference>>.

[role="exclude",id="search-request-query"]
=== Query parameter for request body search API
See <<request-body-search-query>>.

[role="exclude",id="search-request-rescore"]
=== Rescoring parameter for request body search API
See <<request-body-search-rescore>>.
See <<rescore>>.

[role="exclude",id="search-request-script-fields"]
=== Script fields parameter for request body search API
Expand All @@ -119,11 +119,11 @@ See <<search-after>>.

[role="exclude",id="search-request-search-type"]
=== Search type parameter for request body search API
See <<request-body-search-search-type>>.
See <<search-type>>.

[role="exclude",id="search-request-seq-no-primary-term"]
=== Sequence numbers and primary terms parameter for request body search API
See <<request-body-search-search-type>>.
See <<optimistic-concurrency-control>>.

[role="exclude",id="search-request-sort"]
=== Sort parameter for request body search API
Expand All @@ -140,7 +140,7 @@ See <<stored-fields>>.

[role="exclude",id="search-request-track-total-hits"]
=== Track total hits parameter for request body search API
See <<request-body-search-track-total-hits>>.
See <<track-total-hits>>.

[role="exclude",id="search-request-version"]
=== Version parameter for request body search API
Expand Down Expand Up @@ -974,21 +974,25 @@ See <<eql-syntax-limitations>>.

See <<eql-required-fields>>.

////
[role="exclude",id="search-request-body"]
=== Request body search

This page has been removed.

For search API reference documentation, see <<search-search>>.

For search examples, see <<run-a-search>>.
For search examples, see <<search-your-data>>.

[role="exclude",id="request-body-search-docvalue-fields"]
==== Doc value fields

See <<docvalue-fields, doc value fields>>.

[role="exclude",id="_fast_check_for_any_matching_docs"]
==== Fast check for any matching docs

See <<quickly-check-for-matching-docs>>.

[role="exclude",id="request-body-search-collapse"]
==== Field collapsing

Expand All @@ -1009,26 +1013,36 @@ See <<highlighting>>.

See <<how-es-highlighters-work-internally>>.

[role="exclude",id="request-body-search-index-boost"]
==== Index boost
See <<index-boost>>.

[role="exclude",id="request-body-search-inner-hits"]
=== Inner hits
==== Inner hits
See <<inner-hits>>.

[role="exclude",id="request-body-search-min-score"]
=== `min_score`
See <<search-api-min-score>>.
==== `min_score`

See the <<search-api-min-score,`min_score`>> parameter.

[role="exclude",id="request-body-search-queries-and-filters"]
=== Named queries
==== Named queries

See <<named-queries>.
See <<named-queries>>.

[role="exclude",id="request-body-search-post-filter"]
=== Post filter
==== Post filter

See <<post-filter>>.

[role="exclude",id="request-body-search-preference"]
==== Preference

See <<search-preference>>.

[role="exclude",id="request-body-search-rescore"]
=== Rescoring
==== Rescoring

See <<rescore>>.

Expand All @@ -1043,12 +1057,12 @@ See <<script-fields>>.
See <<scroll-search-results>>.

[[_clear_scroll_api]]
===== Clear scroll API
==== Clear scroll API

See <<clear-scroll-api>>.

[[sliced-scroll]]
===== Sliced scroll
==== Sliced scroll

See <<slice-scroll>>.

Expand All @@ -1057,6 +1071,11 @@ See <<slice-scroll>>.

See <<search-after>>.

[role="exclude",id="request-body-search-search-type"]
==== Search type

See <<search-type>>.

[role="exclude",id="request-body-search-sort"]
==== Sort

Expand All @@ -1071,4 +1090,8 @@ See <<source-filtering>>.
==== Stored fields

See <<stored-fields>>.
////

[role="exclude",id="request-body-search-track-total-hits"]
==== Track total hits

See <<track-total-hits>>.
2 changes: 0 additions & 2 deletions docs/reference/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ high). This default value is `5`.

include::search/search.asciidoc[]

include::search/request-body.asciidoc[]

include::search/async-search.asciidoc[]

include::search/scroll-api.asciidoc[]
Expand Down
60 changes: 60 additions & 0 deletions docs/reference/search/quickly-check-for-matching-docs.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[discrete]
[[quickly-check-for-matching-docs]]
=== Quickly check for matching docs

If you only want to know if there are any documents matching a
specific query, you can set the `size` to `0` to indicate that we are not
interested in the search results. You can also set `terminate_after` to `1`
to indicate that the query execution can be terminated whenever the first
matching document was found (per shard).

[source,console]
--------------------------------------------------
GET /_search?q=user.id:elkbee&size=0&terminate_after=1
--------------------------------------------------
// TEST[setup:my_index]

NOTE: `terminate_after` is always applied **after** the
<<post-filter,`post_filter`>> and stops the query as well as the aggregation
executions when enough hits have been collected on the shard. Though the doc
count on aggregations may not reflect the `hits.total` in the response since
aggregations are applied **before** the post filtering.

The response will not contain any hits as the `size` was set to `0`. The
`hits.total` will be either equal to `0`, indicating that there were no
matching documents, or greater than `0` meaning that there were at least
as many documents matching the query when it was early terminated.
Also if the query was terminated early, the `terminated_early` flag will
be set to `true` in the response.

[source,console-result]
--------------------------------------------------
{
"took": 3,
"timed_out": false,
"terminated_early": true,
"_shards": {
"total": 1,
"successful": 1,
"skipped" : 0,
"failed": 0
},
"hits": {
"total" : {
"value": 1,
"relation": "eq"
},
"max_score": null,
"hits": []
}
}
--------------------------------------------------
// TESTRESPONSE[s/"took": 3/"took": $body.took/]


The `took` time in the response contains the milliseconds that this request
took for processing, beginning quickly after the node received the query, up
until all search related work is done and before the above JSON is returned
to the client. This means it includes the time spent waiting in thread pools,
executing a distributed search across the whole cluster and gathering all the
results.
Loading

0 comments on commit a479a2a

Please sign in to comment.