Result window is too large, from + size must be less than or equal to: [10000] but was [100000]

前端 未结 3 1640
深忆病人
深忆病人 2021-02-07 02:23

I got the following Error in elasticSearch:

[Result window is too large, from + size must be less than or equal to: [10000] but was [100000].

相关标签:
3条回答
  • 2021-02-07 02:50

    For django-dsl, to change in INDEX.setting in document file:

        ...
    INDEX = Index(settings.ELASTICSEARCH_INDEX_NAMES[__name__])
    
    INDEX.settings(
        number_of_shards=1,
        number_of_replicas=1,
        blocks={'read_only_allow_delete': None},
        # read_only_allow_delete=False
        max_result_window=settings.MAX_RESULT_WINDOW,
    )
    
    ...
    
    0 讨论(0)
  • 2021-02-07 02:55

    you can change max result window by setting index.max_result_window = 50000; in elasticsearch.yml file in etc/elasticsearch

    0 讨论(0)
  • 2021-02-07 02:57

    You can find here some references to official documentation for deep paging.

    If you need to update the maximum result window in your elasticsearch instance, you can edit settings this way

    curl -XPUT "http://localhost:9200/my_index/_settings" -d '{ "index" : { "max_result_window" : 500000 } }' -H "Content-Type: application/json"
    

    as already discussed here, but pay attention to deep paging, because it could increase memory usage and degrade performance of elasticsearch.

    In order to implement a more efficient search, you should take a look at:

    • Scroll API
    • Search After API
    0 讨论(0)
提交回复
热议问题