Search for a document

edit

Searching is a hallmark of elasticsearch, so let’s perform a search. We are going to use the Match query as a demonstration:

$searchParams['index'] = 'my_index';
$searchParams['type']  = 'my_type';
$searchParams['body']['query']['match']['testField'] = 'abc';
$retDoc = $client->search($searchParams);