Missing _scroll_id in search response when using Python library

The _scroll_id is missing from the search response when using the Python library version 7.9.0 but the response does contain the _scroll_id when I query the API using curl.

For example, the following Python code:

response = self._es_client.search(
            index=index_pattern,
            body=query_body,
            scroll="10m",
            size=size,
        )

Returns this:

{"hits": {"hits": [], "total": {"relation": "eq", "value": 0}, "max_score": 0.0}, "_shards": {"successful": 0, "failed": 0, "skipped": 0, "total": 0}, "took": 0, "timed_out": false}

The following Curl request:

curl -k -u $ES_USR:$ES_PASSWD "$DOMAIN/_search/?scroll=1m" -d '{"size": 100, "query": {"query_string": {"query": "query_body"}}}' -H 'Content-Type: application/json'

Returns this:

{"_scroll_id":"DnF1ZX...QnhFUQ==","took":23,"timed_out":false,"_shards":{"total":45,"successful":45,"skipped":0,"failed":0},"hits":{"total":{"value":0,"relation":"eq"},"max_score":null,"hits":[]}}

You can see that the response from the Python call does not contain the _scroll_id but the response from the Curl call does.

I am using a small three node cluster running version 7.4.0 and using the Python library version 7.9.0.

Any idea about why the _scroll_id is missing when using the Python search request?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.