Search code examples
elasticsearchbulk

What is the default `routing` parameter for Elasticsearch's bulk api?


From the elastic docs:

The default value used for _routing is the document’s _id (regarding PUT api)

But I could not find any default value for bulk api documentation

Should I set _routing mapping manually or is there a default value?


Solution

  • You need to provide the routing value in each command line

                                                     here
                                                       |
                                                       v
    { "index" : { "_index" : "test", "_id" : "1", "_routing": 123 } }
    { "field1" : "value1" }