解决 Elasticsearch 分页查询记录超过10000时异常

查询结果中 hits.total.value 值最大为10000的限制

解决方法:

**1、**请求设置rest_total_hits_as_int=true

注意参数需要放在请求头上

复制代码
 builder.addHeader("rest_total_hits_as_int","true");

2、修改setting的值

复制代码
#设置返回最大记录条数为1000000
PUT /index/_settings
{
    "index": {
        "max_result_window": 1000000
    }
}
#适用于所有索引
put _all/_settings
{
  "index.max_result_window":200000
}
相关推荐
SelectDB2 小时前
秒级弹性、最高降本 70%:SelectDB Serverless 如何重塑云数仓资源效率
大数据·后端·云原生
WhoAmI2 小时前
MapReduce框架原理解析一:InputFormat
大数据·hadoop
WhoAmI2 小时前
MapReduce框架原理解析三:OutputFormat
大数据·hadoop
WhoAmI2 小时前
MapReduce框架原理解析二:Shuffle
大数据·hadoop
大大大大晴天1 天前
Hudi技术内幕:Key Generation原理与实践
大数据
Elasticsearch1 天前
3个信号、2个环境变量、0个采集器:使用 Python 和 Elastic 的托管 OTLP 端点实现 OpenTelemetry
elasticsearch
Elasticsearch3 天前
如何通过 Claude Code 来写入 CSV 数据到 Elasticsearch
elasticsearch
得物技术4 天前
从埋点需求到规则资产:Hermes Agent 重构得物数仓工作流
大数据·llm·ai编程
久美子4 天前
AI驱动数仓建设的Harness工程实践——本体建模、知识分层与上下文工程
大数据