Why doesn't routing work with ElasticSearch Bulk API?

后端 未结 2 1587
渐次进展
渐次进展 2021-02-10 18:21

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 18:47

    @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.

提交回复
热议问题