1

我正在使用 Elasticsearch PHP 包来执行查询。当我执行这个基本搜索查询时,我得到illegal_argument_exception. 该函数 elastic()返回 Elasticsearch 的客户端。

$query = $this->elastic()->search([
    'index' => ['my_index'],
    'type' => 'my_type',
    'from' => 0,
    'size' => 10,
    'body' => [
        'query' => [
            'match_all' => (object)[],
        ]
    ]
]);

错误:

{
    "type": "illegal_argument_exception",
    "reason": "field name is null or empty"
}
4

0 回答 0