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?