我在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"
}
}
}
}
}
}
}发布于 2016-01-03 17:49:42
"dbl_metaphone“是一个令牌过滤器,而不是分析器。您需要首先安装语音分析插件,然后使用它创建一个自定义分析器。在https://www.elastic.co/guide/en/elasticsearch/guide/current/phonetic-matching.html上可以找到更多信息。
https://stackoverflow.com/questions/34579570
复制相似问题