es 中keword 长度异常

报错

用spark 往es写入数据,总是丢失几条数据,进入日志详细查看后发现一个报错

{"index":"*****","type":"_doc","id":"1267565827","cause":{"type":"exception","reason":"Elasticsearch exception [type=illegal_argument_exception, reason=Document contains at least one immense term in field=\"medical_record_info\" (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: '[91, 123, 112, 97, 116, 105, 101, 110, 116, 95, 117, 105, 110, 58, 49, 50, 54, 55, 53, 54, 53, 56, 50, 55, 44, 116, 114, 101, 97, 116]...', original message: bytes can be at most 32766 in length; got 37920]","caused_by":{"type":"exception","reason":"Elasticsearch exception [type=max_bytes_length_exceeded_exception, reason=max_bytes_length_exceeded_exception: bytes can be at most 32766 in length; got 37920]"}},"status":400}
{"index":"*****","type":"_doc","id":"1396085925","cause":{"type":"exception","reason":"Elasticsearch exception [type=illegal_argument_exception, reason=Document contains at least one immense term in field=\"medical_record_info\" (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: '[91, 123, 112, 97, 116, 105, 101, 110, 116, 95, 117, 105, 110, 58, 49, 51, 57, 54, 48, 56, 53, 57, 50, 53, 44, 116, 114, 101, 97, 116]...', original message: bytes can be at most 32766 in length; got 56516]","caused_by":{"type":"exception","reason":"Elasticsearch exception [type=max_bytes_length_exceeded_exception, reason=max_bytes_length_exceeded_exception: bytes can be at most 32766 in length; got 56516]"}},"status":400}
{"index":"*****","type":"_doc","id":"1455758148","cause":{"type":"exception","reason":"Elasticsearch exception [type=illegal_argument_exception, reason=Document contains at least one immense term in field=\"medical_record_info\" (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: '[91, 123, 112, 97, 116, 105, 101, 110, 116, 95, 117, 105, 110, 58, 49, 52, 53, 53, 55, 53, 56, 49, 52, 56, 44, 116, 114, 101, 97, 116]...', original message: bytes can be at most 32766 in length; got 41352]","caused_by":{"type":"exception","reason":"Elasticsearch exception [type=max_bytes_length_exceeded_exception, reason=max_bytes_length_exceeded_exception: bytes can be at most 32766 in length; got 41352]"}},"status":400}
{"index":"*****","type":"_doc","id":"20000063963","cause":{"type":"exception","reason":"Elasticsearch exception [type=illegal_argument_exception, reason=Document contains at least one immense term in field=\"medical_record_info\" (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: '[91, 123, 112, 97, 116, 105, 101, 110, 116, 95, 117, 105, 110, 58, 50, 48, 48, 48, 48, 48, 54, 51, 57, 54, 51, 44, 116, 114, 101, 97]...', original message: bytes can be at most 32766 in length; got 3178084]","caused_by":{"type":"exception","reason":"Elasticsearch exception [type=max_bytes_length_exceeded_exception, reason=max_bytes_length_exceeded_exception: bytes can be at most 32766 in length; got 3178084]"}},"status":400}

whose UTF8 encoding is longer than the max length 32766
异常原因是某个模块的长度太长超过了keyword类型的最大长度,将类型设置成text 就好了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值