-1

I checked this post:

Elasticsearch 2.1: Result window is too large (index.max_result_window)

but, I 'do not' want change index.max_result_window setting.

I wish fix this problem by only DSL Query. It is possible?

{'query': {'bool': {'must': [{'match_phrase': {'TABLE_NAME': 'EZ_CALLLIST'}}]}}, 'from': 9200, 'size': 100}
{'query': {'bool': {'must': [{'match_phrase': {'TABLE_NAME': 'EZ_CALLLIST'}}]}}, 'from': 9300, 'size': 100}
{'query': {'bool': {'must': [{'match_phrase': {'TABLE_NAME': 'EZ_CALLLIST'}}]}}, 'from': 9400, 'size': 100}
{'query': {'bool': {'must': [{'match_phrase': {'TABLE_NAME': 'EZ_CALLLIST'}}]}}, 'from': 9500, 'size': 100}
{'query': {'bool': {'must': [{'match_phrase': {'TABLE_NAME': 'EZ_CALLLIST'}}]}}, 'from': 9600, 'size': 100}
{'query': {'bool': {'must': [{'match_phrase': {'TABLE_NAME': 'EZ_CALLLIST'}}]}}, 'from': 9700, 'size': 100}
{'query': {'bool': {'must': [{'match_phrase': {'TABLE_NAME': 'EZ_CALLLIST'}}]}}, 'from': 9800, 'size': 100}
{'query': {'bool': {'must': [{'match_phrase': {'TABLE_NAME': 'EZ_CALLLIST'}}]}}, 'from': 9900, 'size': 100}
{'query': {'bool': {'must': [{'match_phrase': {'TABLE_NAME': 'EZ_CALLLIST'}}]}}, 'from': 10000, 'size': 100}
Traceback (most recent call last):
  File "./dig4time.py", line 53, in <module>
    res = get_es_body(last_cnt, req_unit)
  File "./dig4time.py", line 33, in get_es_body
    res = es.search(index="my_index", body=es_body)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/utils.py", line 69, in _wrapped
    return func(*args, params=params, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/client/__init__.py", line 539, in search
    doc_type, '_search'), params=params, body=body)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/transport.py", line 327, in perform_request
    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/http_urllib3.py", line 109, in perform_request
    self._raise_error(response.status, raw_data)
  File "/usr/local/lib/python2.7/dist-packages/elasticsearch/connection/base.py", line 113, in _raise_error
    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elasticsearch.exceptions.TransportError: TransportError(500, u'search_phase_execution_exception', u'Result window is too large, from + size must be less than or equal to: [10000] but was [10100]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.')
Community
  • 1
  • 1
Go Namhyeon
  • 631
  • 1
  • 5
  • 15

1 Answers1

0

This case, you can use 'scroll' api without 'from' attribute.

but, If you want use 'from' attribute, must set value less then 'max_result_window' value.

Go Namhyeon
  • 631
  • 1
  • 5
  • 15