I am having a very strange problem with aliases. I have a large number of
queries that I run against an index through an alias that has routing and
filtering included. When I run the requests, I get 0 results. If I recreate
the alias, with the same parameters, I get the expected results. Basically
I have:
Thank you for really nice test case! First of all, there is very simple
workaround for this problem. All you need to do is define path_id in your
mapping before adding the first alias and both aliases will start working.
When an alias is added, the alias filter is immediately parsed and stored
in parsed form for further execution. When you add foobar_162 the field
path_id doesn't exists in the index mapping yet, so the alias filter is
parsed assuming that path_id will be a string. However, when the first
record is added, the path_id field is added to mapping as "long". As a
result, when foobar_162 is used, it tries to filter numeric data using
string filter, which doesn't work. When foobar_162_v2 is added, the filter
in this alias is parsed using correct type of path_id. So, you end up with
two aliases that look exactly the same but internally use two very
different filters.
On Wednesday, October 31, 2012 4:19:55 PM UTC-4, Julien wrote:
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.