What is a correct update endpoint for communication between elastic.v7 client and Elasticsearch 6.x server?

Viewed 8

I am currently getting backwards incompatibility issue when hitting endpoint of /update using elastic.v7 as client to Elasticsearch 6.x server. I noticed that for update, the 7.x endpoint is POST /<index>/_update/<_id>, while the 6.x is expecting POST /<index>/_doc/<_id>/_update.

This results in that when I make update operation from v7 client to 6.x Elasticsearch server, I am seeing the error below

{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can't start with '_', found: [_update]"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can't start with '_', found: [_update]"},"status":400}

I found this difference when I enabled client side tracelog.

Version of Elasticsearch used

elastic.v7 as client (Elasticsearch 6.x server as a way to test backwards compatibility)

Expected behavior

Successful update with POST /<index>/_update/<_id> from v7 client to both Elasticsearch 6.x and 7.x servers.

Actual behavior

Error described above with POST /<index>/_update/<_id> endpoint from v7 client to Elasticsearch 6.x server.

Steps to reproduce the behavior

  1. Spin up a ES 6 server
  2. Use elastic v7 as client
  3. Create an index
  4. Insert a document
  5. Update the document with POST /<index>/_update/<_id> endpoint from elastic.v7

Is this a suggestion of not to use v7 client for 6.x server? Originally I am thinking of sticking this plan as it would be easier to use one client to request to both Elasticsearch servers (v6 and v7).

0 Answers
Related