Deleting documents and inconsistent query behaviour


(Robert Carrington) #1

I have an elasticsearch instance running as service on windows server 2008.
Documents are being inserted by logstash using all the default settings
which means a different index for each day. I want to delete all documents
of a certain type across all indices. I'm using Sense in Chrome (having
tried and failed to get head/inquisitor/browser to do anything useful in
this respect).

If I run the following:
DELETE _all/_query?q=type:iss

I get the following response:
{
"_indices": {
"logstash-2014.01.18": {
"_shards": {
"total": 5,
"successful": 1,
"failed": 4
}
},
"logstash-2014.01.17": {
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
}
},
...
}

I don't seem to get consistent results with this. When I tried it
initially it had no successes, I'm not sure what changed but now it seems
to be mostly successful.

To test if the delete succeeded I ran the following:
GET _search?q=type:iis

POST _search
{"query":{"match":{"type":"iis"}}}

The 1st query initially returned 0, the 2nd query however returned 376
which was original number of documents matching that query. Now both
queries return all 376. Again as far as I'm aware nothing has changed
(logstash isn't running so nothing is inserting documents currently).

If I look on the Overview page for the head plugin, the index
logstash-2014.03.19 initially read "docs: 288 (288)". Now it reads "docs:
3 (7)" so it looks like everything has been deleted (although I don't know
why there is now a discrepancy between the main number and number in
brackets now or what they even mean). Also using the Browser after the
delete, initially only returned 3 documents for that day, now it's
returning all 376 again.

What am I missing and how do I delete documents across all indices? The
only actual success I've had so far is deleting the index itself but that's
obviously not a useful option.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/08b7657b-cb58-4f94-ae0e-e727053c171e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2