Duplicate results with alias and multiple(?) indices

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?

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?

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