0

I indexed the field wrong instead of string i put the type object.

What I tried

Tried to update the type didn't work

curl --location --request PUT 'http://localhost:9200/activity_scheduled_departure/_mapping' \
--header 'Content-Type: application/json' \
--data-raw '{
  "properties": {
    "manualUpdate": {
      "type": "string"
    }
  }
}'

Tried to delete via this link that didn't work Remove a field from a Elasticsearch document

Have anyone another idea how to solve my problem ?

1 Answers1

1

Once a field mapping has been created, it cannot be changed. You need to create a new index with the proper field type in the mapping and reindex your data into the new index.

First create the new index with the adequate mapping:

PUT activity_scheduled_departure2
{
  "mappings": {
    "properties" {
      "manualUpdate": {
        "type": "string"
      },
      ...
    }
  }
}

And then reindex your data from the old index

POST _reindex
{
  "source": {
    "index": "activity_scheduled_departure"
  },
  "dest": {
    "index": "activity_scheduled_departure2"
  }
}
Val
  • 207,596
  • 13
  • 358
  • 360