Skip to content

delete_by_query API "size" parameter not supported in the json request in 6.x #35636

Closed
@narph

Description

@narph

Elasticsearch version (bin/elasticsearch --version):6.x

Description of the problem including expected versus actual behavior:
Steps to reproduce:

testing the "size" parameter inside the json request

post twitter/doc/1
{
 "message":"hello1",
 "num":2
}
post twitter/doc/2
{
 "message":"hello2",
 "num":1
}
post twitter/doc/3
{
 "message":"hello",
 "num":2
}
post twitter/doc/4
{
 "message":"hello",
 "num":2
}

get twitter/_search

POST twitter/_delete_by_query
{
 "query": {
   "bool": {
     "must": [
       {
         "script": {
           "script": {
             "lang": "expression",
             "source": """doc["num"].value ==2"""
           }
         }
       }
     ]
   }
 }
 , "size":2
}

The get twitter/_search returns 2 docs after the delete_by_query call was executed in ES 5.6.x versions.
But it will return 1 doc after the call in 6.x (random testing on 6.0.0, 6.4, 6.5 ), it seems that the "size" param is ignored in the call, the delete_by_query will remove 3 docs instead of 2.

If we add "size" as a query string param then the delete_by_query will delete 2 docs on all versions tested.

POST twitter/_delete_by_query?size=2
{
 "query": {
   "bool": {
     "must": [
       {
         "script": {
           "script": {
             "lang": "expression",
             "source": """doc["num"].value ==2"""
           }
         }
       }
     ]
   }
 }
}

Has this option been removed starting 6.x?
Was not able to find any of these changes in the es docs as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Distributed Indexing/CRUDA catch all label for issues around indexing, updating and getting a doc by id. Not search.>bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions