2
我正在將批量請求設置爲ElasticSearch並指定要路由到的分片。爲什麼不使用ElasticSearch Bulk API工作?
但是當我運行它時,文檔被髮送到不同的分片。
這是ElasticSEarch批量中的錯誤嗎?它只適用於索引單個文檔。它在我搜索時起作用。但是,當我做批量導入時不行。
重現:
curl -XPOST 'http://192.168.1.115:9200/_bulk?routing=a' -d '
{ "index" : { "_index" : "articles", "_type" : "article", "_id" : "1" } }
{ "title" : "value1" }
{ "delete" : { "_index" : "articles", "_type" : "article", "_id" : "2" } }
{ "create" : { "_index" : "articles", "_type" : "article", "_id" : "3" } }
{ "title" : "value3" }
{ "update" : {"_id" : "1", "_type" : "article", "_index" : "index1"} }
{ "doc" : {"field2" : "value2"} }'
剛擡起頭尋找這樣的:[問題](https://github.com/elasticsearch/elasticsearch/issues/4053)已立即修復,今天發佈的[release](http://www.elasticsearch.org/download/)包含修復程序。感謝您報告它,您可能希望更新你的答案,我們也在努力處理文檔,只是你知道。 – javanna
謝謝javanna。但現在我不能在批量導入時爲每個文檔指定_routing字段??? –
如果內存服務不是這個想法,在網址中的是th默認的一個,當沒有指定每個項目時用作回退。 – javanna