gpt4 book ai didi

elasticsearch - MapperParsingException [找不到字段[phonetic]的分析器[dbl_metaphone]]

转载 作者:行者123 更新时间:2023-12-02 23:33:01 29 4
gpt4 key购买 nike

我在Elasticsearch群集上有一个索引,并且我想支持语音匹配。

这是我的要求:

curl -XPUT "http://localhost:9200/propertywebsites/_mapping/doc?pretty" -i -d '
{
"properties" : {
"phoneticbuilding" : {
"type" : "string",
"fields" : {
"phonetic" : {
"type" : "string",
"analyzer" : "dbl_metaphone"
}}}}
}
'

我收到此错误响应:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=UTF-8
Content-Length: 116

{
"error" : "MapperParsingException[Analyzer [dbl_metaphone] not found for field [phonetic]]",
"status" : 400
}

有人对为什么无法针对语音字段识别dbl_metaphone分析器有所了解吗?

我的elasticsearch的版本是 elasticsearch-1.7.2
更新1

我已经有以下分析仪
PUT myIndexName/
{
"settings": {
"analysis": {
"filter": {
"dbl_metaphone": {
"type": "phonetic",
"encoder": "double_metaphone"
}
},
"analyzer": {
"dbl_metaphone": {
"tokenizer": "standard",
"filter": "dbl_metaphone"
}
}
}
}
}

更新2

查询此请求
curl -XGET "http://localhost:9200/propertywebsites/_settings?pretty"

我得到以下回应:
{
"propertywebsites" : {
"settings" : {
"index" : {
"creation_date" : "1451838136296",
"number_of_shards" : "5",
"number_of_replicas" : "1",
"version" : {
"created" : "1070299"
},
"uuid" : "KVOuKVgGRBudsSplownrgg",
"analsis" : {
"filter" : {
"dbl_metaphone" : {
"type" : "phonetic",
"encoder" : "double_metaphone"
}
},
"analyzer" : {
"dbl_metaphone" : {
"filter" : "dbl_metaphone",
"tokenizer" : "standard"
}
}
}
}
}
}
}

最佳答案

“dbl_metaphone”是 token 过滤器,而不是分析器。您需要首先安装“语音分析”插件,然后使用它创建一个自定义分析器。在https://www.elastic.co/guide/en/elasticsearch/guide/current/phonetic-matching.html上找到更多信息。

关于elasticsearch - MapperParsingException [找不到字段[phonetic]的分析器[dbl_metaphone]],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34579570/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com