Try to create an index with a field that is not analyzed in order to perform a string search. But when I try to create the index it generates errors.
In this way I create the index:
PUT / contents
{
"mappings": {
"category": {
"_all": {"enabled": false},
"_source": {"compressed": true},
"properties": {
"name": {"type": "text", "index": "analyzed"}
}
}
}
}
and it generates me error:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [category]: Could not convert [name.index] to boolean"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [category]: Could not convert [name.index] to boolean",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Could not convert [name.index] to boolean",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Failed to parse value [analyzed] as only [true] or [false] are allowed."
}
}
},
"status": 400
}
How it should create that certain fields are not analyzed so you can search the text strings.