【问题标题】:Elasticsearch 'failed to find filter under name 'Elasticsearch '未能在名称下找到过滤器'
【发布时间】:2017-03-13 23:02:12
【问题描述】:

我刚开始使用 ES 5.2.2 尝试支持俄罗斯形态学的广告分析器。 使用 docker 运行 ES,我使用安装的 elasticsearch-analysis-morphology 创建图像。 然后我: 创建索引, 然后设置

然后进行设置,一切正常

curl http://localhost:9200/news/_settings?pretty
{
"news" : {
"settings" : {
  "index" : {
    "number_of_shards" : "5",
    "provided_name" : "news",
    "creation_date" : "1489343955314",
    "analysis" : {
      "analyzer" : {
        "russian_analyzer" : {
          "filter" : [
            "stop",
            "custom_stop",
            "russian_stop",
            "custom_word_delimiter",
            "lowercase",
            "russian_morphology",
            "english_morphology"
          ],
          "char_filter" : [
            "html_strip",
            "ru"
          ],
          "type" : "custom",
          "tokenizer" : "standard"
        }
      },
      "char_filter" : {
        "ru" : {
          "type" : "mapping",
          "mappings" : [
            "Ё=>Е",
            "ё=>е"
          ]
        }
      },
      "filter:" : {
        "custom_stop" : {
          "type" : "stop",
          "stopwords" : [
            "n",
            "r"
          ]
        },
        "russian_stop" : {
          "ignore_case" : "true",
          "type" : "stop",
          "stopwords" : [
            "а",
            "без",
          ]
        },
        "custom_word_delimiter" : {
          "split_on_numerics" : "false",
          "generate_word_parts" : "false",
          "preserve_original" : "true",
          "catenate_words" : "true",
          "generate_number_parts" : "true",
          "catenate_all" : "true",
          "split_on_case_change" : "false",
          "type" : "word_delimiter",
          "catenate_numbers" : "false"
        }
      }
    },
    "number_of_replicas" : "1",
    "uuid" : "IUkHHwWrStqDMG6fYOqyqQ",
    "version" : {
      "created" : "5020299"
    }
  }
 }
}
}

然后我尝试打开索引,但 ES 给了我这个:

{
"error" : {
"root_cause" : [
  {
    "type" : "exception",
    "reason" : "Failed to verify index [news/IUkHHwWrStqDMG6fYOqyqQ]"
  }
],
"type" : "exception",
"reason" : "Failed to verify index [news/IUkHHwWrStqDMG6fYOqyqQ]",
"caused_by" : {
  "type" : "illegal_argument_exception",
  "reason" : "Custom Analyzer [russian_analyzer] failed to find filter         under name [custom_stop]"
}
},
"status" : 500
}

不明白我哪里错了。 谁能看出问题出在哪里?

【问题讨论】:

  • 您发送到 Elastic 节点的查询是什么?
  • @asettouf curl -XPOST 'localhost:9200/news/_open/?pretty'
  • @asettouf 我填写了我的设置语法错误
  • 这是我见过的最奇怪的事情之一,如果我使用您的配置进行测试以创建索引(复制粘贴),我会得到同样的错误,如果我重写它并且它是完全等价,索引创建成功。我现在唯一能看到的是,不知何故,编码被错误地解释了……调试模式下的弹性也没有显示出任何有用的东西……
  • @asettouf o_O 非常奇怪......谢谢。我会尝试重写它。

标签: elasticsearch analyzer


【解决方案1】:

“过滤器”部分出错

 was:

look here this This colon was a mistake
       |
       v
"filter:" : {
    "custom_stop" : {
      "type" : "stop",
      "stopwords" : [
        "n",
        "r"
      ]
    }...

感谢@asettou 和@andrey-morozov

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-10
    • 2017-06-09
    • 1970-01-01
    • 2022-01-06
    • 1970-01-01
    相关资源
    最近更新 更多