elasticsearch默認輸出最多一萬條
查詢第10001條數據開始就會報錯:Result window is too large, from + size must be less than or equal to
但是很多時候10000數據不能滿足項目的需求,所以我們就要解除這個限制。
解決方案一:
1、修改elasticsearch輸出默認限制條數
PUT 索引名稱/_settings?preserve_existing=true { "max_result_window": "1000000" }
2、設置后只對已經存在的索引生效,新建的索引需重新設置
3、設置時索引名稱可以使用通配符進行設置
解決方案二:
創建索引時設置
"settings":{ "index":{ "max_result_window":1000000
}
}