Closed hatienkma closed 7 years ago
https://github.com/elastic/elasticsearch-php/blob/v2.2.2/src/Elasticsearch/Namespaces/IndicesNamespace.php#L31 is probably what you want.
$exists = $client->indices()->exists(['index' => 'your-index-name']);
Do you know the documents ID? You can use the Exists API if you know the index/type/id of a doc.
Oops, just saw @dcarbone reply. Note: that method ($client->indices()->exists([...])
) is for determining if an entire index exists, where as the other exists ($client->exists([...])
) is for checking individual documents
Ah, thanks for the clarification :)
Closing, @hatienkma feel free to reopen if you need more help :)
I want to check exist document before index new document.
I use search param but it not success.
$params = [ 'index' => $indexDB, 'type' => $typeDB, 'body' => [ 'query' => [ 'match' => [ 'email' => $email ] ] ]
];
Any one can recommend query check exists documents?
System details