"Elasticsearch problem 1" When indexing the report mapper_parsing_exception

Source: Internet
Author: User

Error log:
Online write Elasticsearch also have a lot of articles, are written very good, now want to write the error log and solution, I hope some small partners can avoid some problems as soon as possible, spend time on some useful things.

错误日志{"error": {"root_cause": [{"type": "mapper_parsing_exception","reason": "analyzer on field [word] must be set when search_analyzer is set"}],"type": "mapper_parsing_exception","reason": "Failed to parse mapping [doc]: analyzer on field [word] must be set when search_analyzer is set","caused_by": {"type": "mapper_parsing_exception","reason": "analyzer on field [word] must be set when search_analyzer is set"}},"status": 400}

Criteria for indexing:

{  "settings": {    "number_of_shards": 1,    "analysis": {      "filter": {        "ngram_filter": {          "type": "ngram",          "min_gram": 2,          "max_gram": 20        }      },      "analyzer": {        "ngram_analyzer": {          "type": "custom",          "tokenizer": "standard",          "filter": [            "lowercase",            "ngram_filter"          ]        }      }    }  },  "mappings": {    "doc": {      "_all": {        "type": "text",     **   "index_analyzer": "ngram_analyzer",**        "search_analyzer": "standard"      },      "properties": {        "word": {          "type": "text",         ** "index_analyzer": "ngram_analyzer",**          "search_analyzer": "standard"        },        "definition": {          "type": "text"        }      }    }  }}

Why is it? Because mappings in the ELASTICSEARCH5 version of the write parameters are not supported,Index_analyzer will not support, changed to the analyzer, change over, just fine, you can build the index success.

"Elasticsearch Issue 1" is indexed mapper_parsing_exception

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.