mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-08 22:14:59 +00:00
[DOCS] Add collapsible sections to search API response (#55887)
This commit is contained in:
parent
2ac32db607
commit
922a80c3f4
@ -226,14 +226,14 @@ include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
|
|||||||
(Optional, <<query-dsl,query object>>) Defines the search definition using the
|
(Optional, <<query-dsl,query object>>) Defines the search definition using the
|
||||||
<<query-dsl,Query DSL>>.
|
<<query-dsl,Query DSL>>.
|
||||||
|
|
||||||
|
[role="child_attributes"]
|
||||||
[[search-api-response-body]]
|
[[search-api-response-body]]
|
||||||
==== {api-response-body-title}
|
==== {api-response-body-title}
|
||||||
|
|
||||||
`took`::
|
`took`::
|
||||||
+
|
+
|
||||||
--
|
--
|
||||||
(Integer)
|
(integer)
|
||||||
Milliseconds it took {es} to execute the request.
|
Milliseconds it took {es} to execute the request.
|
||||||
|
|
||||||
This value is calculated by measuring the time elapsed
|
This value is calculated by measuring the time elapsed
|
||||||
@ -254,92 +254,114 @@ Took time does *not* include:
|
|||||||
* Time needed to send the response to a client
|
* Time needed to send the response to a client
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
`timed_out`::
|
`timed_out`::
|
||||||
+
|
(boolean)
|
||||||
--
|
|
||||||
(Boolean)
|
|
||||||
If `true`,
|
If `true`,
|
||||||
the request timed out before completion;
|
the request timed out before completion;
|
||||||
returned results may be partial or empty.
|
returned results may be partial or empty.
|
||||||
--
|
|
||||||
|
|
||||||
`_shards`::
|
`_shards`::
|
||||||
|
(object)
|
||||||
|
Contains a count of shards used for the request.
|
||||||
+
|
+
|
||||||
--
|
.Properties of `_shards`
|
||||||
(Object)
|
[%collapsible%open]
|
||||||
Object containing a count of shards used for the request.
|
====
|
||||||
Returned parameters include:
|
|
||||||
|
|
||||||
`total`::
|
`total`::
|
||||||
(Integer)
|
(integer)
|
||||||
Total number of shards that require querying,
|
Total number of shards that require querying,
|
||||||
including unallocated shards.
|
including unallocated shards.
|
||||||
|
|
||||||
`successful`::
|
`successful`::
|
||||||
(Integer)
|
(integer)
|
||||||
Number of shards that executed the request successfully.
|
Number of shards that executed the request successfully.
|
||||||
|
|
||||||
`skipped`::
|
`skipped`::
|
||||||
(Integer)
|
(integer)
|
||||||
Number of shards that skipped the request because a lightweight check
|
Number of shards that skipped the request because a lightweight check
|
||||||
helped realize that no documents could possibly match on this shard. This
|
helped realize that no documents could possibly match on this shard. This
|
||||||
typically happens when a search request includes a range filter and the
|
typically happens when a search request includes a range filter and the
|
||||||
shard only has values that fall outside of that range.
|
shard only has values that fall outside of that range.
|
||||||
|
|
||||||
`failed`::
|
`failed`::
|
||||||
(Integer)
|
(integer)
|
||||||
Number of shards that failed to execute the request. Note that shards
|
Number of shards that failed to execute the request. Note that shards
|
||||||
that are not allocated will be considered neither successful nor failed.
|
that are not allocated will be considered neither successful nor failed.
|
||||||
Having `failed+successful` less than `total` is thus an indication that
|
Having `failed+successful` less than `total` is thus an indication that
|
||||||
some of the shards were not allocated.
|
some of the shards were not allocated.
|
||||||
|
====
|
||||||
--
|
|
||||||
|
|
||||||
`hits`::
|
`hits`::
|
||||||
+
|
(object)
|
||||||
--
|
|
||||||
(Object)
|
|
||||||
Contains returned documents and metadata.
|
Contains returned documents and metadata.
|
||||||
Returned parameters include:
|
|
||||||
|
|
||||||
`total`::
|
|
||||||
(Object)
|
|
||||||
Metadata about the number of returned documents.
|
|
||||||
Returned parameters include:
|
|
||||||
+
|
+
|
||||||
* `value`: Total number of returned documents.
|
.Properties of `hits`
|
||||||
* `relation`: Indicates whether the number of returned documents in the `value`
|
[%collapsible%open]
|
||||||
parameter is accurate or a lower bound. Returned values are:
|
====
|
||||||
** `eq`: Accurate
|
`total`::
|
||||||
** `gte`: Lower bound, including returned documents
|
(object)
|
||||||
|
Metadata about the number of returned documents.
|
||||||
|
+
|
||||||
|
.Properties of `total`
|
||||||
|
[%collapsible%open]
|
||||||
|
=====
|
||||||
|
`value`::
|
||||||
|
(integer)
|
||||||
|
Total number of returned documents.
|
||||||
|
|
||||||
|
`relation`::
|
||||||
|
(string)
|
||||||
|
Indicates whether the number of returned documents in the `value`
|
||||||
|
parameter is accurate or a lower bound.
|
||||||
|
+
|
||||||
|
.Values of `relation`:
|
||||||
|
[%collapsible%open]
|
||||||
|
======
|
||||||
|
`eq`:: Accurate
|
||||||
|
`gte`:: Lower bound, including returned documents
|
||||||
|
======
|
||||||
|
=====
|
||||||
|
|
||||||
`max_score`::
|
`max_score`::
|
||||||
(Float)
|
(float)
|
||||||
Highest returned document `_score`.
|
Highest returned <<search-api-response-body-score,document `_score`>>.
|
||||||
+
|
+
|
||||||
The `_score` parameter is a 32-bit floating point number
|
This value is `null` for requests that do not sort by `_score`.
|
||||||
used to determine the relevance of the returned document.
|
|
||||||
+
|
|
||||||
This parameter value is `null` for requests
|
|
||||||
that do not sort by `_score`.
|
|
||||||
|
|
||||||
|
[[search-api-response-body-hits]]
|
||||||
`hits`::
|
`hits`::
|
||||||
(Array of objects)
|
(array of objects)
|
||||||
Array of returned document objects.
|
Array of returned document objects.
|
||||||
Returned parameters include:
|
|
||||||
+
|
+
|
||||||
* `_index`: Name of the index containing the returned document.
|
.Properties of `hits` objects
|
||||||
* `_type`: Document type.
|
[%collapsible%open]
|
||||||
deprecated:[7.0.0, Types are deprecated and are in the process of being removed. See <<removal-of-types>>.]
|
=====
|
||||||
* `_id`: Unique identifier for the returned document.
|
`_index`::
|
||||||
This ID is only unique within the returned index.
|
(string)
|
||||||
* `_score`: Positive 32-bit floating point number used to determine the
|
Name of the index containing the returned document.
|
||||||
relevance of the returned document.
|
|
||||||
* `_source`: Object containing the original JSON body
|
|
||||||
passed for the document at index time.
|
|
||||||
--
|
|
||||||
|
|
||||||
|
`_type`::
|
||||||
|
deprecated:[6.0.0, Mapping types are deprecated and will be removed in 8.0. See <<removal-of-types>>.]
|
||||||
|
(string)
|
||||||
|
Mapping type of the returned document.
|
||||||
|
|
||||||
|
`_id`::
|
||||||
|
(string)
|
||||||
|
Unique identifier for the returned document.
|
||||||
|
This ID is only unique within the returned index.
|
||||||
|
|
||||||
|
[[search-api-response-body-score]]
|
||||||
|
`_score`::
|
||||||
|
(float)
|
||||||
|
Positive 32-bit floating point number used to determine the relevance of the
|
||||||
|
returned document.
|
||||||
|
|
||||||
|
[[search-api-response-body-source]]
|
||||||
|
`_source`::
|
||||||
|
(object)
|
||||||
|
Original JSON body passed for the document at index time.
|
||||||
|
=====
|
||||||
|
====
|
||||||
|
|
||||||
[[search-search-api-example]]
|
[[search-search-api-example]]
|
||||||
==== {api-examples-title}
|
==== {api-examples-title}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user