我正在尝试找到一种方法来构建我的 $params
数组,使用 native 语法来搜索名称等于“test”的帖子:
$params = [
"index" => "post_index",
"type" => "post",
'body' => [
'query' => [
'match' => [
'name' => 'test'
]
]
]
];
$result = $finder->find($params);
不幸的是我收到了这个错误:
Unknown key for a VALUE_STRING in [index].
我知道我可以使用一些 Elastic\Query\Match
来构建我的查询。
最佳答案
只是我用这种方式修复了我的 $params 数组:
$q = [
'query' => [
'match' => [
'title' => 'test'
]
]
];
关于elasticsearch - [index] 中 VALUE_STRING 的未知键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52742121/