When a scrollService response with no hits in the result, it will return io.EOF error. It make no sense no hits is a EOF error and I don't think it is an error either.
I think the driver should return the response without any error when hits is an empty array.
When I turn on the traceLog, the es server response status is 200.
POST /soa_org_member/member/_search?scroll=5m&size=100 HTTP/1.1
Host: HIDDEN_HOSTNAME:9200
User-Agent: elastic/5.0.79 (darwin-amd64)
Transfer-Encoding: chunked
Accept: application/json
Authorization: Basic HIDDEN
Content-Type: application/json
Accept-Encoding: gzip
*** hidden POST BODY ***
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{"_scroll_id":"HIDDEN SCROLL ID","took":94,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
That's the way it is since, I think, v2. Also, v5 is no longer supported. And even if it were, this is a breaking change that has the potential to impact hundreds or thousands of apps. I'm not going to do that.
Please use the following questions as a guideline to help me answer your issue/question without further inquiry. Thank you.
Which version of Elastic are you using?
[ ] elastic.v7 (for Elasticsearch 7.x) [ ] elastic.v6 (for Elasticsearch 6.x) [x] elastic.v5 (for Elasticsearch 5.x) [ ] elastic.v3 (for Elasticsearch 2.x) [ ] elastic.v2 (for Elasticsearch 1.x)
Please describe the expected behavior
When a scrollService response with no hits in the result, it will return
io.EOF
error. It make no sense no hits is aEOF
error and I don't think it is an error either.I think the driver should return the response without any error when hits is an empty array.
When I turn on the traceLog, the es server response status is 200.
Please describe the actual behavior
I found this line of code here related: https://github.com/olivere/elastic/blob/29ee98974cf1984dfecf53ef772d721fb97cb0b9/scroll.go#L438-L440
Any steps to reproduce the behavior?