【问题标题】:Unknown key for a VALUE_STRING in [index][index] 中 VALUE_STRING 的未知键
【发布时间】:2018-10-10 14:06:39
【问题描述】:

我正在尝试找到一种方法,可以使用本机语法构建我的 $params 数组以搜索名称等于“测试”的帖子:

$params = [
    "index" => "post_index",
    "type" => "post",
    'body' => [
        'query' => [
            'match' => [
                'name' => 'test'
            ]
        ]
    ]
];
$result = $finder->find($params);

不幸的是,我收到了这个错误:

[index] 中 VALUE_STRING 的未知键。

我知道我可以使用一些 Elastic\Query\Match 来构建我的查询。

【问题讨论】:

    标签: elasticsearch foselasticabundle


    【解决方案1】:

    我只是这样修复了我的 $params 数组:

    $q = [
        'query' => [
            'match' => [
                'title' => 'test'
            ]
        ]
    ];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-26
      • 2020-07-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多