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:
>
> {
> "actions" : [
> {
> "add" : {
> "index" : "test",
> "alias" : "test_alias",
> "routing" : {
> "path": "some_id"
> }
> }
> }
> ]
> }'
>
> 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 in advance.
>
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/367f7961-acc5-4fa5-9092-9654739f0012%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.