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 does not work with range query #7259
Comments
This is likely a problem with these clients not being able to send a body with a DELETE request. You could try passing the body as the |
Can you please provide an example using the query I have above? |
|
That still did not work in those clients. { |
I also can use these clients to delete with match_all and ids queries in the body. |
In which case you probably don't have any data in the |
Actually we have data in the _timestamp field as _timestamp is enabled in our mapping file and sorry for the typo before but this query worked: |
and this did not: } which would indicate something in the Delete by Query API does not accept all queries. |
Also one more thing. I ran the same query against a field named ingestDate which is a defined as a dateOptionalTime type in the mapping file and it always has a value and the range query in a search returned 333 documents but with delete on query it failed. The query is below: { } |
This works for me:
This search returns the 2nd and 3rd docs:
This returns only the first doc:
|
@clintongormley What version of elasticsearch are you testing with? |
Originally on master - I went back and tested this on 1.3.1, 1.2.1 and 1.1.2.... turns out this was indeed broken in the 1.1.x branch! Looks like it was fixed by #5540 |
I have a corpus of 1000 documents which have 3 _timestamp ranges between 0-30, 30-60 and 60-90
days. The 0-30 range has 334 documents, and both the 30-60 and the 60-90 each have 333 documents.I attempted to trim the index down by using the Delete by Query API with a range query.to get rid of those documents in range 60-90. When running the query as a search:
{
"query" :
{
"range" :
{
"_timestamp" :
{
"lt" : "now-1440h"
}
}
}
}
I get 333 documents yet when I run as a Delete by Query using ElasticSearch Head or using the Jest client no documents are deleted. I tried using the refresh endpoint and that did not help.
I am running this on ElasticSearch 1.1.0
The text was updated successfully, but these errors were encountered: