【问题标题】:Elastic Search - how to interpret this exception弹性搜索 - 如何解释此异常
【发布时间】:2021-05-26 09:30:09
【问题描述】:

这是我正在运行的代码,它缺少自定义分析器名称。我得到了以下错误

{
  "error": {
    "root_cause": [
      {
        "type": "settings_exception",
        "reason": "Failed to get setting group for [index.analysis.analyzer.] setting prefix and setting [index.analysis.analyzer.filter] because of a missing '.'"
      }
    ],
    "type": "settings_exception",
    "reason": "Failed to get setting group for [index.analysis.analyzer.] setting prefix and setting [index.analysis.analyzer.filter] because of a missing '.'"
  },
  "status": 500
}

代码 sn-p(我知道是什么错误,我们需要提供自定义分析器名称)。我想知道如何解释上述异常以得出有效的解决方案。

PUT myindex5
{
  "settings": {
    "analysis": {
      "char_filter": {
        "my_char_filter":{
          "type":"mapping",
          "mappings":["$ => dollar"]
        }
      },
      "filter": {
        "my_stopwords":{
          "type":"stop",
          "stopwords":["the"]
        }
      }, 
      "analyzer": {
        
         "type":"custom",
         "char_filter":["html_strip","my_char_filter"],
         "tokenizer":"standard",
         "filter":["lowercase","my_stopwords"]
       
      
      }
    }
  }
}

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    该错误消息确实有点神秘,但是如果您查看source code,您会发现它正在尝试找出index.analysis.analyzer 结构中的所有组(即命名分析器)并以index.analysis.analyzer.filter 开头但找不到更多嵌套在该结构中的组,即因为缺少分析器名称。

    【讨论】:

    • 这个运气好吗?
    猜你喜欢
    • 1970-01-01
    • 2012-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 2016-01-17
    • 1970-01-01
    • 2020-10-11
    相关资源
    最近更新 更多