Skip to content

Commit a479a2a

Browse files
authored
[DOCS] Remove search request body page (#60972) (#60978)
1 parent f2733bc commit a479a2a

16 files changed

+135
-241
lines changed

docs/java-rest/high-level/document/multi-get.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ include-tagged::{doc-tests-file}[{api}-request-item-extras]
6565
<2> Version
6666
<3> Version type
6767

68-
{ref}/search-request-body.html#request-body-search-preference[`preference`],
68+
{ref}/search-your-data.html#search-preference[`preference`],
6969
{ref}/docs-get.html#realtime[`realtime`]
7070
and
7171
{ref}/docs-get.html#get-refresh[`refresh`] can be set on the main request but

docs/reference/how-to/recipes/scoring.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ are different too.
2929

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

docs/reference/redirects.asciidoc

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ See <<highlighting>>.
7575

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

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

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

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

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

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

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

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

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

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

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

975975
See <<eql-required-fields>>.
976976

977-
////
978977
[role="exclude",id="search-request-body"]
979978
=== Request body search
980979

981980
This page has been removed.
982981

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

985-
For search examples, see <<run-a-search>>.
984+
For search examples, see <<search-your-data>>.
986985

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

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

991+
[role="exclude",id="_fast_check_for_any_matching_docs"]
992+
==== Fast check for any matching docs
993+
994+
See <<quickly-check-for-matching-docs>>.
995+
992996
[role="exclude",id="request-body-search-collapse"]
993997
==== Field collapsing
994998

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

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

1016+
[role="exclude",id="request-body-search-index-boost"]
1017+
==== Index boost
1018+
See <<index-boost>>.
1019+
10121020
[role="exclude",id="request-body-search-inner-hits"]
1013-
=== Inner hits
1021+
==== Inner hits
10141022
See <<inner-hits>>.
10151023

10161024
[role="exclude",id="request-body-search-min-score"]
1017-
=== `min_score`
1018-
See <<search-api-min-score>>.
1025+
==== `min_score`
1026+
1027+
See the <<search-api-min-score,`min_score`>> parameter.
10191028

10201029
[role="exclude",id="request-body-search-queries-and-filters"]
1021-
=== Named queries
1030+
==== Named queries
10221031

1023-
See <<named-queries>.
1032+
See <<named-queries>>.
10241033

10251034
[role="exclude",id="request-body-search-post-filter"]
1026-
=== Post filter
1035+
==== Post filter
10271036

10281037
See <<post-filter>>.
10291038

1039+
[role="exclude",id="request-body-search-preference"]
1040+
==== Preference
1041+
1042+
See <<search-preference>>.
1043+
10301044
[role="exclude",id="request-body-search-rescore"]
1031-
=== Rescoring
1045+
==== Rescoring
10321046

10331047
See <<rescore>>.
10341048

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

10451059
[[_clear_scroll_api]]
1046-
===== Clear scroll API
1060+
==== Clear scroll API
10471061

10481062
See <<clear-scroll-api>>.
10491063

10501064
[[sliced-scroll]]
1051-
===== Sliced scroll
1065+
==== Sliced scroll
10521066

10531067
See <<slice-scroll>>.
10541068

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

10581072
See <<search-after>>.
10591073

1074+
[role="exclude",id="request-body-search-search-type"]
1075+
==== Search type
1076+
1077+
See <<search-type>>.
1078+
10601079
[role="exclude",id="request-body-search-sort"]
10611080
==== Sort
10621081

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

10731092
See <<stored-fields>>.
1074-
////
1093+
1094+
[role="exclude",id="request-body-search-track-total-hits"]
1095+
==== Track total hits
1096+
1097+
See <<track-total-hits>>.

docs/reference/search.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ high). This default value is `5`.
154154

155155
include::search/search.asciidoc[]
156156

157-
include::search/request-body.asciidoc[]
158-
159157
include::search/async-search.asciidoc[]
160158

161159
include::search/scroll-api.asciidoc[]
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[discrete]
2+
[[quickly-check-for-matching-docs]]
3+
=== Quickly check for matching docs
4+
5+
If you only want to know if there are any documents matching a
6+
specific query, you can set the `size` to `0` to indicate that we are not
7+
interested in the search results. You can also set `terminate_after` to `1`
8+
to indicate that the query execution can be terminated whenever the first
9+
matching document was found (per shard).
10+
11+
[source,console]
12+
--------------------------------------------------
13+
GET /_search?q=user.id:elkbee&size=0&terminate_after=1
14+
--------------------------------------------------
15+
// TEST[setup:my_index]
16+
17+
NOTE: `terminate_after` is always applied **after** the
18+
<<post-filter,`post_filter`>> and stops the query as well as the aggregation
19+
executions when enough hits have been collected on the shard. Though the doc
20+
count on aggregations may not reflect the `hits.total` in the response since
21+
aggregations are applied **before** the post filtering.
22+
23+
The response will not contain any hits as the `size` was set to `0`. The
24+
`hits.total` will be either equal to `0`, indicating that there were no
25+
matching documents, or greater than `0` meaning that there were at least
26+
as many documents matching the query when it was early terminated.
27+
Also if the query was terminated early, the `terminated_early` flag will
28+
be set to `true` in the response.
29+
30+
[source,console-result]
31+
--------------------------------------------------
32+
{
33+
"took": 3,
34+
"timed_out": false,
35+
"terminated_early": true,
36+
"_shards": {
37+
"total": 1,
38+
"successful": 1,
39+
"skipped" : 0,
40+
"failed": 0
41+
},
42+
"hits": {
43+
"total" : {
44+
"value": 1,
45+
"relation": "eq"
46+
},
47+
"max_score": null,
48+
"hits": []
49+
}
50+
}
51+
--------------------------------------------------
52+
// TESTRESPONSE[s/"took": 3/"took": $body.took/]
53+
54+
55+
The `took` time in the response contains the milliseconds that this request
56+
took for processing, beginning quickly after the node received the query, up
57+
until all search related work is done and before the above JSON is returned
58+
to the client. This means it includes the time spent waiting in thread pools,
59+
executing a distributed search across the whole cluster and gathering all the
60+
results.

0 commit comments

Comments
 (0)