Skip to content

Commit 9332a9c

Browse files
committed
Add the fields option to the search API docs. (#62260)
1 parent 4a19bdb commit 9332a9c

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

docs/reference/search/search.asciidoc

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,33 @@ pattern].
332332
For other field data types, this parameter is not supported.
333333
====
334334

335+
`fields`::
336+
(Optional, array of strings and objects)
337+
Array of wildcard (`*`) patterns. The request returns values for field names
338+
matching these patterns in the `hits.fields` property of the response.
339+
+
340+
You can specify items in the array as a string or object.
341+
See <<search-fields-param>> for more details.
342+
+
343+
.Properties of `fields` objects
344+
[%collapsible%open]
345+
====
346+
`field`::
347+
(Required, string)
348+
Wildcard pattern. The request returns values for field names matching this pattern.
349+
350+
`format`::
351+
(Optional, string)
352+
Format in which the values are returned.
353+
+
354+
The date fields <<date,`date`>> and <<date_nanos, `date_nanos`>> accept a
355+
<<mapping-date-format,date format>>. <<spatial_datatypes, Spatial fields>> accept either
356+
`geojson` for http://www.geojson.org[GeoJSON] (the default) or `wkt` for
357+
{wikipedia}/Well-known_text_representation_of_geometry[Well Known Text].
358+
+
359+
For other field data types, this parameter is not supported.
360+
====
361+
335362
[[request-body-search-explain]]
336363
`explain`::
337364
(Optional, boolean) If `true`, returns detailed information about score
@@ -358,7 +385,7 @@ are supported.
358385
`<boost-value>` is the factor by which scores are multiplied.
359386
+
360387
A boost value greater than `1.0` increases the score. A boost value between
361-
`0` and `1.0` decreases the score.
388+
`0` and `1.0` decreases the score.
362389
====
363390

364391
[[search-api-min-score]]

0 commit comments

Comments
 (0)