Julie Tibshirani 99f89cd3b4
Deprecate types in get, exists, and multi get. (#35930)
For each API, the following updates were made:
- Add deprecation warnings to `Rest*Action`, plus tests in `Rest*ActionTests`.
- For each REST yml test, make sure there is one version without types, and another legacy version that retains types (called *_with_types.yml).
- Deprecate relevant methods on the Java HLRC requests/ responses.
- Update documentation (for both the REST API and Java HLRC).
2018-12-10 17:22:48 -08:00

38 lines
1.2 KiB
Plaintext

--
:api: exists
:request: GetRequest
:response: boolean
--
[id="{upid}-{api}"]
=== Exists API
The exists API returns `true` if a document exists, and `false` otherwise.
[id="{upid}-{api}-request"]
==== Exists Request
It uses +{request}+ just like the <<java-rest-high-document-get>>.
All of its <<java-rest-high-document-get-request-optional-arguments, optional arguments>>
are supported. Since `exists()` only returns `true` or `false`, we recommend
turning off fetching `_source` and any stored fields so the request is
slightly lighter:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
<1> Index
<2> Document id
<3> Disable fetching `_source`.
<4> Disable fetching stored fields.
include::../execution.asciidoc[]
==== Source exists request
A variant of the exists request is `existsSource` method which has the additional check
that the document in question has stored the `source`. If the mapping for the index has opted
to remove support for storing JSON source in documents then this method will return false
for documents in this index.