-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
ElasticSearch Docker 6.5.4
Linux
- Create dynamic template using scaled_float type
{
"balance": {
"match": "balance",
"mapping": {
"scaling_factor": 100,
"type": "scaled_float"
}
}
}
- Post new instance with very big number
POST /tokens/doc/1
{
"balance": 18000000000000000000000000000000000000000000000
}
ElasticSearch throw error:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "failed to parse"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse",
"caused_by": {
"type": "illegal_state_exception",
"reason": "No matching token for number_type [BIG_INTEGER]"
}
},
"status": 400
}
- Post another data using string type, then delete this item and finally post data from step 2. ElasticSearch worked well and index right data
3.1. Post string data
POST /tokens/doc/1
{
"balance": "18000000000000000000000000000000000000000000000"
}
{
"_index": "tokens",
"_type": "doc",
"_id": "1",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 2,
"failed": 0
},
"_seq_no": 0,
"_primary_term": 1
}
3.2. Delete this record and post data from step 2
{
"_index": "tokens",
"_type": "doc",
"_id": "1",
"_version": 3,
"found": true,
"_source": {
"balance": 1.8e+46
}
}