5

Elasticsearch scroll api gives me this error

{
   "error": {
      "root_cause": [
         {
            "type": "parsing_exception",
            "reason": "Unknown key for a VALUE_STRING in [scroll].",
            "line": 2,
            "col": 15
         }
      ],
      "type": "parsing_exception",
      "reason": "Unknown key for a VALUE_STRING in [scroll].",
      "line": 2,
      "col": 15
   },
   "status": 400
}

my code to get documents using scroll api is

GET index/type/_search?scroll=1m
{
    "size": 1000, 
   "query": {
      "match_all": {}
   }
}

this gives me nice result with "_scroll_id"

{
   "_scroll_id": "DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAB1dFmJRbm9UR3h4UUFTVHFzV1dJMHpuOVEAAAAAAAAdXxZiUW5vVEd4eFFBU1Rxc1dXSTB6bjlRAAAAAAAAHV4WYlFub1RHeHhRQVNUcXNXV0kwem45UQAAAAAAAB1gFmJRbm9UR3h4UUFTVHFzV1dJMHpuOVEAAAAAAAAdYhZiUW5vVEd4eFFBU1Rxc1dXSTB6bjlR",
   "took": 37,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },

now according to the documentation I should do like this

GET /_search
{
    "scroll": "1m",
    "scroll_id": "DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAB1dFmJRbm9UR3h4UUFTVHFzV1dJMHpuOVEAAAAAAAAdXxZiUW5vVEd4eFFBU1Rxc1dXSTB6bjlRAAAAAAAAHV4WYlFub1RHeHhRQVNUcXNXV0kwem45UQAAAAAAAB1gFmJRbm9UR3h4UUFTVHFzV1dJMHpuOVEAAAAAAAAdYhZiUW5vVEd4eFFBU1Rxc1dXSTB6bjlR"
}

and this is giving me above error. Am I using scroll api in a wrong way ? ES version is 5.5.1 and kibana version is 5.5.1. I am using kibana to access ES server.

2
  • 2
    I should have used GET /_search/scroll , I forgot to add scroll at the end. It killed my sweet 2 hours Commented Sep 21, 2017 at 6:25
  • 1
    why not add it as an answer as well. it will help others with the same problem :) Commented Sep 21, 2017 at 6:57

1 Answer 1

9

The problem was that I need to have

GET /_search/scroll
{
    "scroll": "1m",
    "scroll_id": "DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAB1dFmJRbm9UR3h4UUFTVHFzV1dJMHpuOVEAAAAAAAAdXxZiUW5vVEd4eFFBU1Rxc1dXSTB6bjlRAAAAAAAAHV4WYlFub1RHeHhRQVNUcXNXV0kwem45UQAAAAAAAB1gFmJRbm9UR3h4UUFTVHFzV1dJMHpuOVEAAAAAAAAdYhZiUW5vVEd4eFFBU1Rxc1dXSTB6bjlR"
}

I forgot to add /scroll after _search. It works now

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

1 Comment

Basically it is a problem with the query parameter

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.