【发布时间】:2018-03-19 05:45:41
【问题描述】:
我一直在尝试将字段存储为类型关键字以支持区分大小写的文本搜索,
但是当我尝试存储长度超过 32766 个字符的文本时,它无法存储它,出现以下异常
Elasticsearch exception [type=illegal_argument_exception, reason=Document contains at least one immense term in field="case_message_message.lowcase" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms. The prefix of the first immense term is: '[-32, -80, -84, -32, -79, -122, -32, -80, -126, -32, -80, -105, -32, -80, -77, -32, -79, -126, -32, -80, -80, -32, -79, -127, 58, 32, -32, -80, -107, -32]...', original message: bytes can be at most 32766 in length; got 37632]
有什么办法可以把这段文字存储在32766以上,
弹性搜索版本 6.1.2
非常感谢任何帮助。
更新 1:
这是我使用自定义规范器和规范器的索引的映射
{
"org-16-database": {
"mappings": {
"org-16-table": {
"properties": {
"My field": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
},
"lowcase": {
"type": "keyword",
"normalizer": "my_normalizer"
}
},
"fielddata": true
}
}
}
}
}
}
设置
{
"org-16-database": {
"settings": {
"index": {
"number_of_shards": "5",
"provided_name": "org-16-database",
"creation_date": "1521198435444",
"analysis": {
"normalizer": {
"my_normalizer": {
"filter": [
"lowercase"
],
"type": "custom"
}
}
},
"number_of_replicas": "1",
"uuid": "lN-7iYloQWy7oaD3uMIYGQ",
"version": {
"created": "6010299"
}
}
}
}
}
【问题讨论】:
-
你试过
keyword这个类型 -
是的,我将类型作为关键字来存储文本字段@Vijayakumar
-
我已经粘贴了下面的链接。你能试试吗。 @Raviteja Gannoju
-
您能否发布您的索引设置。这将有助于缩小问题范围。
-
我已经更新了我的问题以及我的映射@Vijayakumar
标签: java elasticsearch keyword maxlength