my opinion is my own

Amazon Elasticsearch Serviceでindex.max_result_windowの値を変更

Amazon Elasticsearch Service で index.max_result_window を変更する方法と確認する方法をメモ。変更に伴いクラスターのレイテンシーとメモリへの注意が必要。

Index modules | Elasticsearch Reference [7.8] | Elastic https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html

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.

変更

curl -H "Content-Type: application/json" -XPUT 'https://vpc-xxx-xxxx.ap-northeast-1.es.amazonaws.com/xxxx/_settings' -d '
{
  "index": {
    "max_result_window" : "1000000"
  }
}'

確認

curl -X GET "https://vpc-xxx-xxx.ap-northeast-1.es.amazonaws.com/xxxx/_settings?pretty"

結果

[ec2-user@bastin ~]$ curl -H "Content-Type: application/json" -XPUT 'https://vpc-xxx-xxxxx.ap-northeast-1.es.amazonaws.com/xxxxx/_settings' -d '
> {
>   "index": {
>     "max_result_window" : "1000000"
>   }
> }'
[ec2-user@bastin ~]$ curl -X GET "https://vpc-xx-xx.ap-northeast-1.es.amazonaws.com/xxxxx/_settings?pretty"
{
  "amazon_neptune" : {
    "settings" : {
      "index" : {
        "number_of_shards" : "1",
        "provided_name" : "xxxxx",
        "max_result_window" : "1000000",
        "creation_date" : "1595601039642",
        "number_of_replicas" : "1",
        "uuid" : "05kXhekxQ5KUfqyI4_nABw",
        "version" : {
          "created" : "7040299"
        }
      }
    }
  }
---

関連しているかもしれない記事


#AWS #Elasticsearch