0

I'm using elasticsearch-7.8.1 and following the scroll API to scroll datas.My data count is 356054 and get 10 per request.

But after my first scroll request,I just got a "terminated_early ":true and no further scroll_id for me to make next request.

Is there something wrong?

Below is my requests and responses.

Search request

POST http://192.168.10.168:9200/index_name/_search?scroll=60m
{
    "query": {
        "match_all": {}
      }
}

Response

{
    "_scroll_id": "FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFERvaGtyM01CNExwbm50ZG1DNFAtAAAAAAAADLUWSDgxaWkwdUNSNktWYk0xbUw1aG00dw==",
    "took": 2,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 356054,
            "relation": "eq"
        },
        "max_score": 1.0,
        "hits": [//datas]
    }
}

Scroll request

POST http://192.168.10.168:9200/_search/scroll
{
    "scroll_id": "FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFERvaGtyM01CNExwbm50ZG1DNFAtAAAAAAAADLUWSDgxaWkwdUNSNktWYk0xbUw1aG00dw=="
}

Response

{
    "took": 1,
    "timed_out": false,
    "terminated_early": true,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 356054,
            "relation": "eq"
        },
        "max_score": 1.0,
        "hits": [//datas]
    }
}
2

1 Answer 1

1

I know it's been a little while since you asked, but if anyone stumbles upon this from a Google search:

You need to specify scroll (i.e. 1m) in the scroll request body. For example:

POST http://192.168.10.168:9200/_search/scroll
{
    "scroll_id": "FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFERvaGtyM01CNExwbm50ZG1DNFAtAAAAAAAADLUWSDgxaWkwdUNSNktWYk0xbUw1aG00dw==",
    "scroll": "1m"
}

I ran in to the same issue and it appears to have solved the problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.