os: centos 7.6 es: 7.6
index.max_result_window The maximum value of from + size for searches to this index. Defaults to 10000. Search requests take heap memory and time proportional to from + size and this limits that memory. See Scroll or Search After for a more efficient alternative to raising this.
这是个动态参数,可以实时调整。
版本
# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
# yum list installed |grep -i elasticsearch
elasticsearch.x86_64 7.6.2-1 installed
# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.211 n1
192.168.56.212 n2
192.168.56.213 n3
192.168.56.214 n4
max_result_window
curl -X PUT 'http://192.168.56.211:9200/testindex1' -H 'Content-Type: application/json' -d '
{
"settings": {
"number_of_shards": 8,
"number_of_replicas" : 2
}
}
'
curl -X GET 'http://192.168.56.211:9200/testindex1/_settings?pretty'
{
"testindex1" : {
"settings" : {
"index" : {
"creation_date" : "1628491780428",
"number_of_shards" : "8",
"number_of_replicas" : "2",
"uuid" : "tEffkMpPRHuLftMch57W6g",
"version" : {
"created" : "7060299"
},
"provided_name" : "testindex1"
}
}
}
}
curl -X PUT 'http://192.168.56.211:9200/testindex1/_settings' -H 'Content-Type: application/json' -d '
{
"index" : {
"max_result_window" : 100000000
}
}
'
curl -X GET 'http://192.168.56.211:9200/testindex1/_settings?pretty'
{
"testindex1" : {
"settings" : {
"index" : {
"number_of_shards" : "8",
"provided_name" : "testindex1",
"max_result_window" : "100000000",
"creation_date" : "1628491780428",
"number_of_replicas" : "2",
"uuid" : "tEffkMpPRHuLftMch57W6g",
"version" : {
"created" : "7060299"
}
}
}
}
}
参考: https://www.elastic.co/guide/en/elasticsearch/reference/7.6/index-modules.html https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-request-body.html#request-body-search-search-after https://www.elastic.co/guide/en/elasticsearch/reference/7.6/search-request-body.html#request-body-search-scroll
|