# Kibana 4 and KOPF showing deleted documents deleted from Elasticsearch

**URL:** <https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928>\
**Category:** Kibana\
**Created:** [November 5, 2015, 10:03pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928 "2015-11-05T22:03:16Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [November 5, 2015, 10:03pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/1 "2015-11-05T22:03:17Z")

</div>

I am facing the same issue. I deleted some documents from elasticsearch indices for specific type, using the  
curl -XDELETE [http://localhost:9200/logstash\*/xyztype](http://localhost:9200/logstash*/xyztype)

When I query the elasticsearch for the same type it doesnt return any result. The message is:

```
{
"took" : 166,
"timed_out" : false,
"_shards" : {
"total" : 1035,
"successful" : 1035,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [
]
}
}

```

But when browsing results in Kibana Discover screen and visualizing by types, that type is still there with many records of that type. I have no idea on whats going on. Also the KOPF plugin is also showing the same count of records that Kibana Discover interface is showing without any filters.

What is wrong is it Elasticsearch or Kibana.? Pls help

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [November 6, 2015, 3:50pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/2 "2015-11-06T15:50:04Z")

</div>

Any guidance on this? I am still seeing results in Kibana visualization in the bar chart for the type that should not be there as I have deleted that type in elasticsearch.

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [November 6, 2015, 5:32pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/3 "2015-11-06T17:32:16Z")

</div>

I tried doing a bit more research and tried running the query suggested here [Clear deleted docs](https://discuss.elastic.co/t/clear-deleted-docs/22652/2).  
$ curl -XPOST '[http://localhost:9200/twitter/\_optimize?max\_num\_segments=1](http://localhost:9200/twitter/_optimize?max_num_segments=1)'

This made all the size of my indexes less over 80 MB but the number of documents shown are still the same in KOPF interface.

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [November 7, 2015, 4:30pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/4 "2015-11-07T16:30:09Z")

</div>

Have you refreshed your mappings in Kibana?

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [November 7, 2015, 4:35pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/5 "2015-11-07T16:35:07Z")

</div>

Yes, I have done the refresh several times from the Kibana Settings and selecting logstash-\* index.

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [November 7, 2015, 4:35pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/6 "2015-11-07T16:35:35Z")

</div>

Could you post some screenshots of what you see in Kibana?

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [November 7, 2015, 4:46pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/7 "2015-11-07T16:46:55Z")

</div>

The column marked with arrow should not be there. It has more than 600000 records, which I deleted from elasticsearch.  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/b/b2d9b014b1dc9726c414f337a25883ca80d55938.png)

Also the document count marked with arrow should be less by the same number as shown in Kibana column chart for that \_type. The total count should be around 1316384-600000  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/93e14f34b3e2b20e372df1c82a0f47c8fd284610.png)

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [November 7, 2015, 5:36pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/8 "2015-11-07T17:36:37Z")

</div>

Great, and just for completeness, which versions of Kibana and ES are you running?

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [November 7, 2015, 8:34pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/9 "2015-11-07T20:34:10Z")

</div>

Running Kibana 4.1.2 and ES 1.5.2

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [November 9, 2015, 4:42pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/10 "2015-11-09T16:42:35Z")

</div>

Deleting an index in not an option as these indexes are already in production and conatain many \_types of records, only can delete a \_type in the indexes

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [November 12, 2015, 10:47pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/11 "2015-11-12T22:47:11Z")

</div>

Any advice on this? Bump

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:09pm UTC](https://discuss.elastic.co/t/kibana-4-and-kopf-showing-deleted-documents-deleted-from-elasticsearch/33928/12 "2017-07-06T14:09:12Z")

</div>


