简体   繁体   English

Elasticsearch 同义词错误 - mapper_parsing_exception

[英]Elasticsearch synomys error - mapper_parsing_exception

I'm trying to run the code below but I'm getting this error.我正在尝试运行下面的代码,但出现此错误。 Please help me fix it.请帮我修复它。 Thanks:谢谢:

PUT synonyms_hotel
{
  "settings": {
    "index": {
      "analysis": {
        "analyzer": {
          "synonym_analyzer": {
            "tokenizer": "standard",
            "filter": [
              "lowercase",
              "synonym_graph"
            ]
          }
        },
        "filter": {
          "synonym_graph": {
            "type": "synonym_graph",
            "synonyms": [
              "courtyard, marriot"
            ]
          }
        }
      }
    }
  },
  "mappings": {
    "hotel": {
      "properties": {
        "name": {
          "type": "text",
          "fields": {
            "raw": {
              "type": "keyword"
            }
          }
        },
        "city": {
          "type": "text",
          "fields": {
            "raw": {
              "type": "keyword"
            }
          }
        },
        "name_suggest": {
          "type": "completion",
          "analyzer": "autocomplete",
          "search_analyzer": "standard"
        }
      }
    }
  }
}

Error:错误:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "mapper_parsing_exception",
        "reason" : "Root mapping definition has unsupported parameters:  [hotel : {properties={name_suggest={search_analyzer=standard, analyzer=autocomplete, type=completion}, city={type=text, fields={raw={type=keyword}}}, name={type=text, fields={raw={type=keyword}}}}}]"
      }
    ],
    "type" : "mapper_parsing_exception",
    "reason" : "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [hotel : {properties={name_suggest={search_analyzer=standard, analyzer=autocomplete, type=completion}, city={type=text, fields={raw={type=keyword}}}, name={type=text, fields={raw={type=keyword}}}}}]",
    "caused_by" : {
      "type" : "mapper_parsing_exception",
      "reason" : "Root mapping definition has unsupported parameters:  [hotel : {properties={name_suggest={search_analyzer=standard, analyzer=autocomplete, type=completion}, city={type=text, fields={raw={type=keyword}}}, name={type=text, fields={raw={type=keyword}}}}}]"
    }
  },
  "status" : 400
}

You're probably using Elasticsearch 7+ and the mapping types have been deprecated , so you simply need to remove the hotel level:您可能正在使用 Elasticsearch 7+ 并且映射类型已被弃用,因此您只需删除hotel级别:

PUT synonyms_hotel
{
  "settings": {
    "index": {
      "analysis": {
        "analyzer": {
          "synonym_analyzer": {
            "tokenizer": "standard",
            "filter": [
              "lowercase",
              "synonym_graph"
            ]
          }
        },
        "filter": {
          "synonym_graph": {
            "type": "synonym_graph",
            "synonyms": [
              "courtyard, marriot"
            ]
          }
        }
      }
    }
  },
  "mappings": {
      "properties": {                     <--- remove hotel here
        "name": {
          "type": "text",
          "fields": {
            "raw": {
              "type": "keyword"
            }
          }
        },
        "city": {
          "type": "text",
          "fields": {
            "raw": {
              "type": "keyword"
            }
          }
        },
        "name_suggest": {
          "type": "completion",
          "analyzer": "autocomplete",
          "search_analyzer": "standard"
        }
      }
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Elasticsearch mapper_parsing_exception - Elasticsearch mapper_parsing_exception mapper_parsing_exception | Elasticsearch | 全球序号 - mapper_parsing_exception | Elasticsearch | Global Ordinal Elasticsearch 6.5.4 中的 mapper_parsing_exception - mapper_parsing_exception in Elasticsearch 6.5.4 Elasticsearch TransportError(400,&#39;mapper_parsing_exception&#39;) - Elasticsearch TransportError(400, 'mapper_parsing_exception') Elasticsearch批量索引“ mapper_parsing_exception” - Elasticsearch bulk index “mapper_parsing_exception” 邮递员中的“ mapper_parsing_exception”错误 - “mapper_parsing_exception” error in postman 弹性搜索 mapper_parsing_exception 错误 - Elastic Search mapper_parsing_exception error fluent-plugin-elasticsearch:“无法将日志推送到Elasticsearch”错误,错误为“ error” =&gt; {“ type” =&gt;“ mapper_parsing_exception”} - fluent-plugin-elasticsearch: “Could not push log to Elasticsearch” error with “error”=>{“type”=>“mapper_parsing_exception”} 来自Mongodb的带有Elasticsearch的MongoConnector mapper_parsing_exception - MongoConnector mapper_parsing_exception with elasticsearch from Mongodb 将Elasticsearch从5.5.1降级到2.1.0 mapper_parsing_exception - Downgrading Elasticsearch from 5.5.1 to 2.1.0 mapper_parsing_exception
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM