如何在Elasticsearch PHP中使用分析器

时间:2019-07-14 13:51:19

标签: php elasticsearch laravel-5.5

我试图使用elasticsearch但我想使用arabic_normalization但每次使用分析器时都会出现此错误

  

{“错误”:{“ root_cause”:[{“ type”:“ parsing_exception”,“ reason”:“ [analyzer]中START_OBJECT的未知键。”,“ line”:1,“ col”: 102}],“ type”:“ parsing_exception”,“ reason”:“ [analyzer]中START_OBJECT的未知密钥。”,“ line”:1,“ col”:102},“ status”:400}

这是我的代码

 'body' => [
            'query' => [
                'multi_match' => [
                    'fields' => ['title^5', 'body'],
                    'query' => $query,
                ],
            ],
            'analyzer' => [
                'arabic' => [
                    'tokenizer' => 'standard',
                    'filter' => [
                        'lowercase',
                        'decimal_digit',
                        'arabic_stop',
                        'arabic_normalization',
                        'arabic_keywords',
                        'arabic_stemmer'
                    ]
                ]
            ]
        ],

0 个答案:

没有答案