Why doesn't routing work with ElasticSearch Bulk API?

后端 未结 2 1421
灰色年华
灰色年华 2021-02-10 18:20

I am setting a Bulk request to ElasticSearch and specifying the shard to route to.

But when I run it, the documents get sent to different shards.

Is this a bug i

2条回答
  •  不要未来只要你来
    2021-02-10 19:06

    @Henley Chiu has given the correct answer, I add one detail:

    • before es 6.1, you can use _routing or routing field for each individual document when bulk
    • after es 6.1(included), you can only use routing

    So, you'd better use routing for better future compatibility.

提交回复
热议问题