修复 ElasticSearch 'Unknown key for a VALUE_NUMBER in [offset].'

错误消息

es_error_output.txt
Unknown key for a VALUE_NUMBER in [offset].

在 ElasticSearch 中告诉你,你在查询 JSON 中指定了 offset(数值),但 ElasticSearch 不知道如何处理 offset

这很容易修复:为了指定起始偏移量,使用 from 而不是 offset

不正确:

es_offset_incorrect.json
{
    "size": 250,
    "offset": 1000
}

正确:

es_from_correct.json
{
    "size": 250,
    "from": 1000
}

Check out similar posts by category: Databases, ElasticSearch