为了账号安全,请及时绑定邮箱和手机立即绑定

弹性搜索错误:自定义分析器[custom_analyzer]找不到名称为

弹性搜索错误:自定义分析器[custom_analyzer]找不到名称为

摇曳的蔷薇 2021-04-04 12:11:58
我正在尝试与我的custom_analyzer&进行字段映射,tokenizer但出现了一些错误。映射字段时,请找到以下来自kibana的错误Custom Analyzer [custom_analyzer] failed to find tokenizer under name [my_tokenizer]请找到我的地图详细信息。PUT attach_local    {        "settings": {        "analysis": {          "analyzer": {            "custom_analyzer": {              "type": "custom",              "tokenizer": "my_tokenizer",              "char_filter": [                "html_strip"              ],              "filter": [                "lowercase",                "asciifolding"              ]            }           }          }        },        "tokenizer": {        "my_tokenizer": {          "type": "ngram",          "min_gram": 3,              "max_gram": 3,          "token_chars": [            "letter",            "digit"          ]        }      },      "mappings" : {        "doc" : {          "properties" : {            "attachment" : {              "properties" : {                "content" : {                  "type" : "text",                  "analyzer": "custom_analyzer"                },                "content_length" : {                  "type" : "long"                },                "content_type" : {                  "type" : "text"                },                "language" : {                  "type" : "text"                }              }            },            "resume" : {              "type" : "text"            }          }        }      }    }
查看完整描述

1 回答

?
郎朗坤

TA贡献1921条经验 获得超9个赞

正确缩进JSON非常重要。您会发现令牌生成器未正确放置在该analysis部分中。这是正确的定义:


{

  "settings": {

    "analysis": {

      "analyzer": {

        "custom_analyzer": {

          "type": "custom",

          "tokenizer": "my_tokenizer",

          "char_filter": [

            "html_strip"

          ],

          "filter": [

            "lowercase",

            "asciifolding"

          ]

        }

      },

      "tokenizer": {

        "my_tokenizer": {

          "type": "ngram",

          "min_gram": 3,

          "max_gram": 3,

          "token_chars": [

            "letter",

            "digit"

          ]

        }

      }

    }

  },

  "mappings": {

    "doc": {

      "properties": {

        "attachment": {

          "properties": {

            "content": {

              "type": "text",

              "analyzer": "custom_analyzer"

            },

            "content_length": {

              "type": "long"

            },

            "content_type": {

              "type": "text"

            },

            "language": {

              "type": "text"

            }

          }

        },

        "resume": {

          "type": "text"

        }

      }

    }

  }

}


查看完整回答
反对 回复 2021-04-21
  • 1 回答
  • 0 关注
  • 1478 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信