I recently noticed an issue with my elastic cluster where it seems to ignore the routing values passed into the query and returns documents that belong to another alias.
Looking at my aliases they have the correct routing values. Also this doesn't seem to by cluster wide. Not every alias can see every document, and there doesn't seem to be an alias that can see all documents. There are just specific aliases that seem to share with each-other.
Routing ensures that all documents with the same routing value ends up in the same shard. That does not mean that only data with that routing value will be present in that shard. If you want the alias to only see a subset of values, you need to combine it with a filter.
If you search with routing, only a single shard is searched. This will contain all documents indexed with that routing key, but also other documents. As only one single shard is searched, only a subset of documents can be returned.
Ah, that makes sense. So it just gets me to the shard reducing the number of documents I have to sift through, but If another alias is on the same shard it can see the same stuff. I still have to account for filtering that subset. Thanks for the explanation!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.