简体   繁体   中英

Elasticsearch index analyzer settings

I am a beginner for elastic search. I tried to add an analyzer to my index. Here is the coding:

PUT drug_mono6/_settings
{
"analysis": {
"analyzer": {
  "attachment.content": {
    "type": "custom",
    "tokenizer": "Whitespace"
  }
}
}
}

However, I was not able to reopen the index after doing that. The error I received is:

{
"error": {
"root_cause": [
{
"type": "exception",
"reason": "Failed to verify index [drug_mono6/SMmaJ4iPTCSUHp-oedsadA]"
}
],
"type": "exception",
"reason": "Failed to verify index [drug_mono6/SMmaJ4iPTCSUHp-oedsadA]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "analyzer [attachment] must specify either an analyzer type, or 
 a tokenizer"
}
},
"status": 500
}`

Is there a way to modify the settings and remove the changes?

this should work

PUT drug_mono6
{
    "analysis": {
        "analyzer": {
            "attachment": {
                "type": "custom",
                "tokenizer": "whitespace"
            }
        }
    }
}

https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM