max_bytes_length_exceeded_exception: Document contains at least one immense term that is too long(文档中至少包含一个过长的超大词项)
Elasticsearch含义
在被索引的文档中,某个词项(尤其是 keyword/不分析字段的值)超过了允许的最大字节长度(32766 字节)。Lucene 无法索引如此长的词项。
原因
向 keyword 字段(作为整体)写入了非常长的文本值;例如把整个文档正文、base64 数据或很长的 URL/标识符放进 keyword 字段。由于 keyword 字段不做分析,该值被作为单个词项索引,从而超出限制。
解决方法
长文本使用 text(分析型)字段;keyword 仅用于需要精确匹配的短值。要限制值的长度,在映射中使用 ignore_above(超过该长度的值不会被索引,但仍会被存储)。如果不需要,将超长字段设置为 index:false。根据数据类型重新评估字段设计(text 还是 keyword)。
同一数据库的其他条目
- too_many_buckets_exceptionTrying to create too many buckets(试图创建过多的桶)
- shard_lock_obtain_failed_exceptionObtaining shard lock timed out(获取分片锁超时)
- parsing_exceptionFailed to parse the search request / query DSL(无法解析搜索请求/query DSL)
- illegal_argument_exception_total_fieldsLimit of total fields has been exceeded(已超出字段总数限制)
- verification_exceptionverification_exception: Found N problem(s) — Unknown column / Unknown index (ES|QL, SQL, EQL)(验证异常:发现 N 个问题 —— 未知列/未知索引)
- bind_transport_exceptionbind_transport_exception (Address already in use)(地址已被占用)
- translog_corrupted_exceptiontranslog_corrupted_exception