MapperParsingException [Analyzer [dbl_metaphone] 未找到字段 [phonetic]]

MapperParsingException [Analyzer [dbl_metaphone] not found for field [phonetic]]

我在 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" 是令牌过滤器而不是分析器。您需要先安装语音分析 plug-in,然后使用它创建自定义分析器。在 https://www.elastic.co/guide/en/elasticsearch/guide/current/phonetic-matching.html.

找到更多信息