Error when doing bulk index: [illegal_argument_exception] explicit index in bulk is not allowed

Hello. I am using elasticsearch 5.1.1 on the AWS hosted elasticsearch (meaning, I have no ability to change the configuration in a material way).

We recently moved our architecture from a single-server ES 1.7 to the hosted 5.1.1 and my job is to get everything running on the new version.

So far, things have been running smoothly, however we have a script (nodejs) that uses the official javascript driver to move data from our database to elasticsearch. It uses bulk index commands. I am getting the error:

{ [Error: [illegal_argument_exception] explicit index in bulk is not allowed]
  status: 400,
  displayName: 'BadRequest',
  message: '[illegal_argument_exception] explicit index in bulk is not allowed',
  path: '/_bulk',
  query: {},
  body: '{"index":{"_index":"cards.2017-02-08","_type":"card","_id":23891342}}\n{"id":23891342,"entity_id":28400,"type":"news"}\n',
  statusCode: 400,
  response: '{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"explicit index in bulk is not allowed"}],"type":"illegal_argument_exception","reason":"explicit index in bulk is not allowed"},"status":400}',
  toString: [Function],
  toJSON: [Function] }

I've searched a lot of places before posting here and I can't seem to figure out what this error is actually saying. Am I doing something wrong? Does this have something to do with the allow_explicit_index (which I'm guessing I can't change since I have no access to elasticsearch.yml)?

What does this error mean, and is there any way to fix it or work around it given the circumstances?

Thanks for any help!

Fixed it, the solution was:

  • Log into AWS
  • Go to Elasticsearch service
  • Go into the domain
  • Click Configure cluster
  • Scroll to bottom, open "Advanced options..." menu
  • Make sure rest.action.multi.allow_explicit_index is set to true
  • Save, wait the 15 minutes it takes to propagate, profit.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.