Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
narph opened this issue Nov 16, 2018 · 4 comments
Closed
Labels
>bug :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search.

Comments

@narph
Copy link
Contributor

narph commented Nov 16, 2018

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.

@nik9000 nik9000 added the :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. label Nov 16, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@nik9000
Copy link
Member

nik9000 commented Nov 16, 2018

Has this option been removed starting 6.x?

I don't believe we've intentionally changed this, no.

@PnPie
Copy link
Contributor

PnPie commented Nov 20, 2018

Hi @nik9000
it seems that the "size" parameter in request body doesn't work anymore during some previous changes, I created a PR for it.

@cbuescher cbuescher added the >bug label Nov 20, 2018
@henningandersen
Copy link
Contributor

@PnPie this should be fixed now by #41894 where we renamed size to max_docs, fixing confusion on the different size parameters in place. I will therefore close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants