|
@@ -92,7 +92,7 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=df]
|
|
|
|
|
|
`docvalue_fields`::
|
|
|
(Optional, string) A comma-separated list of fields to return as the docvalue
|
|
|
-representation of a field for each hit.
|
|
|
+representation of a field for each hit. See <<docvalue-fields>>.
|
|
|
|
|
|
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
|
|
|
+
|
|
@@ -241,11 +241,12 @@ By default, you cannot page through more than 10,000 hits using the `from` and
|
|
|
`sort`::
|
|
|
(Optional, string) A comma-separated list of <field>:<direction> pairs.
|
|
|
|
|
|
+[[search-source-param]]
|
|
|
`_source`::
|
|
|
(Optional)
|
|
|
Indicates which <<mapping-source-field,source fields>> are returned for matching
|
|
|
documents. These fields are returned in the `hits._source` property of
|
|
|
-the search response. Defaults to `true`.
|
|
|
+the search response. Defaults to `true`. See <<source-filtering>>.
|
|
|
+
|
|
|
.Valid values for `_source`
|
|
|
[%collapsible%open]
|
|
@@ -275,7 +276,7 @@ purposes.
|
|
|
`stored_fields`::
|
|
|
(Optional, string) A comma-separated list of stored fields to return as part
|
|
|
of a hit. If no fields are specified, no stored fields are included in the
|
|
|
-response.
|
|
|
+response. See <<stored-fields>>.
|
|
|
+
|
|
|
If this field is specified, the `_source` parameter defaults to `false`. You can
|
|
|
pass `_source: true` to return both source fields and
|
|
@@ -344,13 +345,14 @@ If `true`, returns document version as part of a hit. Defaults to `false`.
|
|
|
==== {api-request-body-title}
|
|
|
|
|
|
[[search-docvalue-fields-param]]
|
|
|
+// tag::docvalue-fields-def[]
|
|
|
`docvalue_fields`::
|
|
|
(Optional, array of strings and objects)
|
|
|
-Array of wildcard (`*`) patterns. The request returns doc values for field names
|
|
|
-matching these patterns in the `hits.fields` property of the response.
|
|
|
+Array of field patterns. The request returns values for field names matching
|
|
|
+these patterns in the `hits.fields` property of the response.
|
|
|
+
|
|
|
-You can specify items in the array as a string or object.
|
|
|
-See <<docvalue-fields>>.
|
|
|
+You can specify items in the array as a string or object. See
|
|
|
+<<docvalue-fields>>.
|
|
|
+
|
|
|
.Properties of `docvalue_fields` objects
|
|
|
[%collapsible%open]
|
|
@@ -371,19 +373,22 @@ pattern].
|
|
|
+
|
|
|
For other field data types, this parameter is not supported.
|
|
|
====
|
|
|
+// end::docvalue-fields-def[]
|
|
|
|
|
|
[[search-api-fields]]
|
|
|
+// tag::fields-param-def[]
|
|
|
`fields`::
|
|
|
(Optional, array of strings and objects)
|
|
|
-Array of wildcard (`*`) patterns. The request returns values for field names
|
|
|
-matching these patterns in the `hits.fields` property of the response.
|
|
|
+Array of field patterns. The request returns values for field names matching
|
|
|
+these patterns in the `hits.fields` property of the response.
|
|
|
+
|
|
|
-You can specify items in the array as a string or object.
|
|
|
+You can specify items in the array as a string or object. See
|
|
|
+<<search-fields-param>>.
|
|
|
+
|
|
|
.Properties of `fields` objects
|
|
|
[%collapsible%open]
|
|
|
====
|
|
|
-// tag::fields-api-props[]
|
|
|
+// tag::fields-param-props[]
|
|
|
`field`::
|
|
|
(Required, string) Field to return. Supports wildcards (`*`).
|
|
|
|
|
@@ -425,8 +430,21 @@ returns the tile as a base64-encoded string.
|
|
|
square with equal sides. Defaults to `4096`.
|
|
|
========
|
|
|
--
|
|
|
-// end::fields-api-props[]
|
|
|
+// end::fields-param-props[]
|
|
|
====
|
|
|
+// end::fields-param-def[]
|
|
|
+
|
|
|
+[[search-stored-fields-param]]
|
|
|
+// tag::stored-fields-def[]
|
|
|
+`stored_fields`::
|
|
|
+(Optional, string) A comma-separated list of stored fields to return as part
|
|
|
+of a hit. If no fields are specified, no stored fields are included in the
|
|
|
+response. See <<stored-fields>>.
|
|
|
++
|
|
|
+If this option is specified, the `_source` parameter defaults to `false`. You
|
|
|
+can pass `_source: true` to return both source fields and stored fields in the
|
|
|
+search response.
|
|
|
+// end::stored-fields-def[]
|
|
|
|
|
|
[[request-body-search-explain]]
|
|
|
`explain`::
|
|
@@ -579,11 +597,12 @@ By default, you cannot page through more than 10,000 hits using the `from` and
|
|
|
`size` parameters. To page through more hits, use the
|
|
|
<<search-after,`search_after`>> parameter.
|
|
|
|
|
|
+// tag::source-filtering-def[]
|
|
|
`_source`::
|
|
|
(Optional)
|
|
|
Indicates which <<mapping-source-field,source fields>> are returned for matching
|
|
|
documents. These fields are returned in the `hits._source` property of
|
|
|
-the search response. Defaults to `true`.
|
|
|
+the search response. Defaults to `true`. See <<source-filtering>>.
|
|
|
+
|
|
|
.Valid values for `_source`
|
|
|
[%collapsible%open]
|
|
@@ -623,6 +642,7 @@ If this property is specified, only these source fields are returned. You can
|
|
|
exclude fields from this subset using the `excludes` property.
|
|
|
=====
|
|
|
====
|
|
|
+// end::source-filtering-def[]
|
|
|
|
|
|
[[stats-groups]]
|
|
|
`stats`::
|
|
@@ -733,25 +753,25 @@ Contains returned documents and metadata.
|
|
|
====
|
|
|
`total`::
|
|
|
(object)
|
|
|
-Metadata about the number of returned documents.
|
|
|
+Metadata about the number of matching documents.
|
|
|
+
|
|
|
.Properties of `total`
|
|
|
[%collapsible%open]
|
|
|
=====
|
|
|
`value`::
|
|
|
(integer)
|
|
|
-Total number of returned documents.
|
|
|
+Total number of matching documents.
|
|
|
|
|
|
`relation`::
|
|
|
(string)
|
|
|
-Indicates whether the number of returned documents in the `value`
|
|
|
+Indicates whether the number of matching documents in the `value`
|
|
|
parameter is accurate or a lower bound.
|
|
|
+
|
|
|
.Values of `relation`:
|
|
|
[%collapsible%open]
|
|
|
======
|
|
|
`eq`:: Accurate
|
|
|
-`gte`:: Lower bound, including returned documents
|
|
|
+`gte`:: Lower bound
|
|
|
======
|
|
|
=====
|
|
|
|
|
@@ -799,6 +819,7 @@ or specify which source fields to return.
|
|
|
Contains field values for the documents. These fields must be specified in the
|
|
|
request using one or more of the following request parameters:
|
|
|
|
|
|
+* <<search-fields-param,`fields`>>
|
|
|
* <<search-docvalue-fields-param,`docvalue_fields`>>
|
|
|
* <<script-fields,`script_fields`>>
|
|
|
* <<stored-fields,`stored_fields`>>
|