IMPORTANT: elasticsearch.js has been replaced by the new Elasticsearch JavaScript client. We strongly advise you to migrate to the new client. To learn more, see the migration guide.
exists
editexists
editclient.exists([params, [callback]])
Returns a boolean indicating whether or not a given document exists.
Check the API Conventions and the elasticsearch docs for more information pertaining to this method.
Check that the document /myindex/mytype/1 exist.
const exists = await client.exists({
index: 'myindex',
type: 'mytype',
id: 1
});
Params
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|