# Duplicate results with alias and multiple(?) indices

**URL:** <https://discuss.elastic.co/t/duplicate-results-with-alias-and-multiple-indices/80743>\
**Category:** Elasticsearch\
**Created:** [March 30, 2017, 8:44pm UTC](https://discuss.elastic.co/t/duplicate-results-with-alias-and-multiple-indices/80743 "2017-03-30T20:44:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjost](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gjost/32/16920_2.png) [@gjost](https://discuss.elastic.co/u/gjost)\
**Post date:** [March 30, 2017, 8:44pm UTC](https://discuss.elastic.co/t/duplicate-results-with-alias-and-multiple-indices/80743/1 "2017-03-30T20:44:01Z")

</div>

I have a dataset that I've fed into Elasticsearch several times and I'm getting strange results.

Yesterday I fed the data in to index "mydb-20170329" and then created an alias "mydb-dev" pointing to it. Everything worked as normal. Today I fed data into index "mydb-20170330". I removed the alias and recreated it pointing to the new index. Now, when I do queries each document appears twice in the result set.

The indices are as follows:

```
$ http -b localhost:9200/_cat/indices?v
health status index pri rep docs.count docs.deleted store.size pri.store.size 
yellow open mydb-20170329 5 1 301296 2 146.8mb 146.8mb
yellow open mydb-20170330 5 1 301296 2 146.7mb 146.7mb 

```

There is only a single alias:

```
$ http -b localhost:9200/_cat/aliases?v
alias index filter routing.index routing.search 
mydb-dev mydb-20170330 - - -              

```

I understand that an alias can point to multiple indices. This would explain the duplicate results. But this alias only points at the single index. What's going on?

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [March 31, 2017, 12:39am UTC](https://discuss.elastic.co/t/duplicate-results-with-alias-and-multiple-indices/80743/2 "2017-03-31T00:39:58Z")

</div>

Each document in the hits list should have the name of the index this document came, the type of the document and the document id. When you say that each document appears twice do they appear with the same values in all 3 fields or they have different indices, different ids or different types? Can you show the example of the request and the response?

---

<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:** [April 28, 2017, 12:40am UTC](https://discuss.elastic.co/t/duplicate-results-with-alias-and-multiple-indices/80743/3 "2017-04-28T00:40:08Z")

</div>

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