We'd like to have also an alias so that the client code is decoupled from
the index setup. But I don't managed to specify a field for routing, like some_id, in an alias, other than a specific value.
I've tried:
And that doesn't seems to work. Is it possible to set a field as the
routing parameter for an index?
If I set the routing to some specific value of some_id, like 1, 2, it
works like a charm but it means we need to create an alias for every
possible value of some_id.
Setting a routing path on an alias is not possible. The reason is that an
alias also has to work for searches/reads where there is no context of a
document's content to resolve the routing value. Think for example of
search (/test_alias/_search) or document retrieval by ID (GET
/test_alias/type/1). Those
Cheers,
Boaz
On Sunday, December 29, 2013 11:08:02 AM UTC+1, Han JU wrote:
Hi,
We have put routing on a index, like:
_routing: {
path: some_id
required: true
}
We'd like to have also an alias so that the client code is decoupled from
the index setup. But I don't managed to specify a field for routing, like some_id, in an alias, other than a specific value.
I've tried:
And that doesn't seems to work. Is it possible to set a field as the
routing parameter for an index?
If I set the routing to some specific value of some_id, like 1, 2, it
works like a charm but it means we need to create an alias for every
possible value of some_id.
Thanks Boaz.
That makes sence. I'll add the routing information in our queries.
在 2013年12月30日星期一UTC+1上午9时05分49秒,Boaz Leskes写道:
HI Han,
Setting a routing path on an alias is not possible. The reason is that an
alias also has to work for searches/reads where there is no context of a
document's content to resolve the routing value. Think for example of
search (/test_alias/_search) or document retrieval by ID (GET
/test_alias/type/1). Those
Cheers,
Boaz
On Sunday, December 29, 2013 11:08:02 AM UTC+1, Han JU wrote:
Hi,
We have put routing on a index, like:
_routing: {
path: some_id
required: true
}
We'd like to have also an alias so that the client code is decoupled from
the index setup. But I don't managed to specify a field for routing, like some_id, in an alias, other than a specific value.
I've tried:
And that doesn't seems to work. Is it possible to set a field as the
routing parameter for an index?
If I set the routing to some specific value of some_id, like 1, 2, it
works like a charm but it means we need to create an alias for every
possible value of some_id.
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.