我正在创建一个方法来搜索泰语单词的elasticsearch和kibana。我在Map绘制方面有问题。
PUT test
{
"settings": {
"analysis": {
"analyzer": {
"trigrams": {
"tokenizer": "trigram_tokenizer",
"filter": [
"lowercase"
]
}
},
"tokenizer": {
"trigram_tokenizer": {
"type": "ngram",
"min_ngram": 3,
"max_ngram": 3,
"token_chars": []
}
}
}
},
"mappings": {
"true_name": {
"properties": {
"correct": { "type": "text", "analyzer": "trigrams" }
}
}
}
}
像这样的错误
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [true_name : {properties={correct={analyzer=trigrams, type=text}}}]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [true_name : {properties={correct={analyzer=trigrams, type=text}}}]",
"caused_by" : {
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [true_name : {properties={correct={analyzer=trigrams, type=text}}}]"
}
},
"status" : 400
}
1条答案
按热度按时间xam8gpfp1#
不推荐使用Map类型。请参阅此文档以了解有关删除Map类型的更多信息。
在elasticsearch 6.0.0或更高版本中创建的索引只能包含一种Map类型。在5.x中创建的具有多种Map类型的索引将继续像在ElasticSearch6.x中一样工作。在ElasticSearch7.0.0的API中,类型将被弃用,而在8.0.0中,类型将被完全删除。
如果您的json文档如下所示:
然后索引Map将-