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 with Max_Docs parameter #1537

Closed
avi94 opened this issue Oct 6, 2021 · 3 comments
Closed

Delete_By_Query with Max_Docs parameter #1537

avi94 opened this issue Oct 6, 2021 · 3 comments
Milestone

Comments

@avi94
Copy link

avi94 commented Oct 6, 2021

Please use the following questions as a guideline to help me answer
your issue/question without further inquiry. Thank you.

Which version of Elastic are you using?

[ ] elastic.v7 (for Elasticsearch 7.x)

Please describe the expected behavior

I expected to be able to use max_docs parameter with the delete_by_query.

Please describe the actual behavior

Cannot find if there is max_docs parameter option to use with delete_by_query. I have searched for a while but couldn't find it in the library.

Any steps to reproduce the behavior?

Here is a snippet of what I am doing:

esResponseSalesRepMaterial, err := elastic.NewDeleteByQueryService(esClient).Index(salesRepMaterialsIndex).Slices(150).Query(boolQuery).Refresh("true").Do(context.Background())

And what I want to be able to do here is, use max_docs with this.

A dummy query to show what I'm trying:

POST /index_name/_delete_by_query?refresh=true&version&slices=100&max_docs=100000 { "query": { "bool": { "must": { "range": { "created_timestamp": { "from": null, "include_lower": true, "include_upper": false, "to": 1633344763 } } } } } }

This works perfectly fine in Kibana, and I need to do the same in our backend code.

Thanks in advance!

@olivere
Copy link
Owner

olivere commented Oct 6, 2021

Yep, that's missing. Thanks for reporting.

Should be a simple fix, will set it on the list for 7.0.30 (currently waiting for ES to fix an issue, hopefully in 7.15.1).

@olivere olivere added this to the 7.0.30 milestone Oct 6, 2021
@olivere olivere closed this as completed in 9e03315 Oct 6, 2021
@avi94
Copy link
Author

avi94 commented Oct 6, 2021

Thanks @olivere! Meanwhile, any alternatives?

@olivere
Copy link
Owner

olivere commented Oct 6, 2021

You can always use Client.PerformRequest directly. Other than that... no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants