Too long frame exception2 (#137)

* Updating test matrix for 7.6 + removing oss for now.

* Resolving 7.6.0 docs issues

* Updating ML docs

* Fixing too_long_frame_exception in scan/scroll
This commit is contained in:
Stephen Dodson 2020-02-28 12:49:59 +00:00 committed by GitHub
parent a33ff45ebc
commit 43e4d03b39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -591,7 +591,17 @@ class Operations:
# Only return requested field_names # Only return requested field_names
_source = query_compiler.get_field_names(include_scripted_fields=False) _source = query_compiler.get_field_names(include_scripted_fields=False)
if not _source: if _source:
# For query_compiler._client.search we could add _source
# as a parameter, or add this value in body.
#
# If _source is a parameter it is encoded into to the url.
#
# If _source is a large number of fields (1000+) then this can result in an
# extremely long url and a `too_long_frame_exception`. Therefore, add
# _source to the body rather than as a _source parameter
body['_source'] = _source
else:
_source = False _source = False
es_results = None es_results = None
@ -602,16 +612,7 @@ class Operations:
if size is not None and size <= DEFAULT_ES_MAX_RESULT_WINDOW: if size is not None and size <= DEFAULT_ES_MAX_RESULT_WINDOW:
if size > 0: if size > 0:
try: try:
# For query_compiler._client.search we could add _source
# as a parameter, or add this value in body.
#
# If _source is a parameter it is encoded into to the url.
#
# If _source is a large number of fields (1000+) then this can result in an
# extremely long url and a `too_long_frame_exception`. Therefore, add
# _source to the body rather than as a _source parameter
if _source:
body['_source'] = _source
es_results = query_compiler._client.search( es_results = query_compiler._client.search(
index=query_compiler._index_pattern, index=query_compiler._index_pattern,
@ -624,8 +625,7 @@ class Operations:
'index': query_compiler._index_pattern, 'index': query_compiler._index_pattern,
'size': size, 'size': size,
'sort': sort_params, 'sort': sort_params,
'body': body, 'body': body
'_source': _source
} }
print("Elasticsearch error:", error) print("Elasticsearch error:", error)
raise raise
@ -633,8 +633,7 @@ class Operations:
is_scan = True is_scan = True
es_results = query_compiler._client.scan( es_results = query_compiler._client.scan(
index=query_compiler._index_pattern, index=query_compiler._index_pattern,
query=body, query=body)
_source=_source)
# create post sort # create post sort
if sort_params is not None: if sort_params is not None:
post_processing.append(SortFieldAction(sort_params)) post_processing.append(SortFieldAction(sort_params))