将查询匹配与 elasticsearch-py 一起使用时,我无法应用自定义分析器。
我定制了一个名为custom_lowercase_stemmed
并用于es.indices.put_settings
更新索引设置的分析器。
但是,当我进行搜索时,它找不到分析器。
我还查看了 in 中的参数analyzer
,es.search
但它返回错误:
..无法识别的参数:[分析器]
关于定制分析仪,我可以在这里得到任何建议吗?谢谢!
query_body = {
"query": {
"match": {
"employer":{
"query": txt,
"fuzziness": 'AUTO',
"analyzer" : 'custom_lowercase_stemmed'
}
}
}
}
es.search(index='hello',body=query_body)
这是完整的错误:
RequestError: RequestError(400, 'search_phase_execution_exception', '[match] analyzer [custom_lowercase_stemmed] not found')