I create an index named test
via a PUT
request using:
PUT http://localhost:9250/test
{
"settings": {
"analysis": {
"char_filter": {
"&_to_and": {
"type": "mapping",
"mappings": ["& => and"]
}
},
"filter": {
"my_stopwords": {
"type": "stop",
"stopwords": ["the", "a"]
}
},
"analyzer": {
"my_analyzer": {
"type": "custom",
"char_filter": ["html_strip", "&_to_and"],
"tokenizer": "standard",
"filter": ["lowercase", "my_stopwords"]
},
"folding": {
"token_filters": ["lowercase", "asciifolding"],
"tokenizer": "standard",
"type": "custom"
}
}
}
},
"mappings": {
"tweet": {
"dynamic": "strict",
"properties": {
"author": {
"type": "string",
"index": "my_analyzer",
"store": true
},
"text": {
"type": "string",
"index": "folding",
"store": true
},
"timestamp": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ssZ",
"store": true
}
}
}
}
}
But this returns the following error:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "wrong value for index [my_analyzer] for field [author]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [tweet]: wrong value for index [my_analyzer] for field [author]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "wrong value for index [my_analyzer] for field [author]"
}
},
"status": 400
}
The json that I am sending seems to be valid. What is the reason of this error?
I am using ES 2.2.0.