Get API, refresh=wait_for not allowed

Hi!
I'm using elasticsearch 7.4.2. Docs are saying that I can set refresh parameter with wait_for value. But if I try to do this, an error is returned:

GET http://0.0.0.0:9200/events/_doc/31780294-6529-425d-b0fa-7b03b9485ca4?refresh=wait_for

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Failed to parse value [wait_for] as only [true] or [false] are allowed."}],"type":"illegal_argument_exception","reason":"Failed to parse value [wait_for] as only [true] or [false] are allowed."},"status":400}

Welcome!

Tested on 7.6 and was able to reproduce the problem.

DELETE test 
PUT test/_doc/1
{
  "foo": "bar"
}
GET test/_doc/1?refresh=wait_for

Gives:

# GET test/_doc/1?refresh=wait_for
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Failed to parse value [wait_for] as only [true] or [false] are allowed."
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Failed to parse value [wait_for] as only [true] or [false] are allowed."
  },
  "status" : 400
}

Refresh=wait_for works well for the PUT document API though:

PUT test/_doc/1?refresh=wait_for
{
  "foo": "bar"
}

Could you open an issue in elasticsearch repository? It's at least a documentation issue IMHO.

Thanks for reporting!

Thanks.
Issue created: https://github.com/elastic/elasticsearch/issues/55970

1 Like

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