I am using the Elasticsearch PHP package for execute queries. When I execute this basic search query, i get the illegal_argument_exception
. The function elastic()
returns the Client of Elasticsearch.
$query = $this->elastic()->search([
'index' => ['my_index'],
'type' => 'my_type',
'from' => 0,
'size' => 10,
'body' => [
'query' => [
'match_all' => (object)[],
]
]
]);
Error:
{
"type": "illegal_argument_exception",
"reason": "field name is null or empty"
}