# IDs of indexes that doesnt exists

**URL:** <https://discuss.elastic.co/t/ids-of-indexes-that-doesnt-exists/209490>\
**Category:** Kibana\
**Created:** [November 26, 2019, 11:15am UTC](https://discuss.elastic.co/t/ids-of-indexes-that-doesnt-exists/209490 "2019-11-26T11:15:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Incauto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/incauto/32/60149_2.png) [@Incauto](https://discuss.elastic.co/u/Incauto)\
**Post date:** [November 26, 2019, 11:15am UTC](https://discuss.elastic.co/t/ids-of-indexes-that-doesnt-exists/209490/1 "2019-11-26T11:15:10Z")

</div>

Hi, I have IDs of indexes that doesnt exists.  
When I run the folowing painless code in scripted fields I have many IDs that return empty strings, something that shouldn happen because in all my indexes I have a field called "server".

```
if (doc.containsKey('server.keyword')) {
  return doc['server.keyword'].value;
} else {
  return '';
}

```

I had copy the IDs that returns empty strings and look up for it in discover filters, and discover tell me that "No results match your search criteria"

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/1/815328721e459cb38ac34d23ca247309811063e6.png)

Where this "ghost" IDs come from? deleted indexes?, what can I do to get rid of them?

---

<div class="post-metadata">

**Author:** ![christophilus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christophilus/32/42991_2.png) [@christophilus](https://discuss.elastic.co/u/christophilus)\
**Post date:** [November 26, 2019, 4:17pm UTC](https://discuss.elastic.co/t/ids-of-indexes-that-doesnt-exists/209490/2 "2019-11-26T16:17:36Z")

</div>

I'm not entirely sure, and I'd have to see your full query, and probably look at your dataset. But if you want to only process documents that have a value for server.keyword, it seems you should filter on that, no?

---

<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:** [December 24, 2019, 4:17pm UTC](https://discuss.elastic.co/t/ids-of-indexes-that-doesnt-exists/209490/3 "2019-12-24T16:17:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
