chengpohi/edql

es6 edit index add field error

Closed this issue · 1 comments

image
image

{
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: mapping type is missing;"
      }
    ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: mapping type is missing;"
  },
  "status": 400
}

In idea.log, I found:

2022-06-06 22:18:13,323 [12312313] WARN - o.e.c.RestClient - request [PUT http://xxx:12313/aaa/_mapping] returned 1 warnings: [299 Elasticsearch-6.8.6-3d9f765 "[types removal] Specifying types in put mapping requests is deprecated. To be compatible with 7.0, the mapping definition should not be nested under the type name, and the parameter include_type_name must be provided and set to false."]

Hi @psuvjd for edql newest version is not supporting create index with type, since es type is deprecated

you can use script directly to create index with type, edql script mode support all version elasticsearch

example(https://www.elastic.co/guide/en/elasticsearch/reference/6.6/indices-create-index.html):

PUT test
{
  "settings" : {
    "number_of_shards" : 1
  },
  "mappings" : {
    "_doc" : {
      "properties" : {
        "field1" : {
          "type" : "text"
        }
      }
    }
  }
}

If you still meet any issues, welcome feedback again