我正在尝试使用定义的分析器创建一个带有文本和关键字映射的索引,这是我到目前为止所尝试的:
{
"settings" : {
"number_of_shards" : 2,
"number_of_replicas" : 1
},
"analysis": {
"normalizer": {
"my_normalizer": {
"type": "custom",
"char_filter": [],
"filter": ["lowercase", "asciifolding"]
}
}
}
,
"mappings": {
"properties": {
"question": {
"type":"text",
"fields": {
"keyword": {
"type": "keyword"
},
"normalize": {
"type": "keyword",
"normalizer": "my_normalizer"
}
}
}
}
}
}
我已经尝试过了,但出现错误:
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "unknown key [analysis] for create index"
}
],
"type": "parse_exception",
"reason": "unknown key [analysis] for create index"
},
"status": 400
}
问题是我需要添加此映射的字段。我正在 AWS ES 服务中尝试这个。