es报错:Numeric value () out of range of int (-2147483648 - 2147483647)
一,报错:
{"index":{"_index":"my_office","_id":"48","status":400
,"error":{"type":"document_parsing_exception","reason":"[1:1123] failed to parse field [payment] of type [integer] in document with id '48'. Preview of field's value: '360000
0000'","caused_by":{"type":"x_content_parse_exception","reason":"[1:1133] Numeric value (3600000000) out of range of int (-2147483648 - 2147483647)
at [Source: (byte[])\
二,原因:
int类型在Elasticsearch中通常表示为32位有符号整数,其取值范围是-2,147,483,648 到 2,147,483,647
三,解决:
使用long类型替代int类型,因为long类型的取值范围更大(-9,223,372,036,854,775,808 到 9,223,372,036,854,775,807)