# Update index type on field. It is possible?

**URL:** <https://discuss.elastic.co/t/update-index-type-on-field-it-is-possible/319049>\
**Category:** Elasticsearch\
**Created:** [November 16, 2022, 9:40am UTC](https://discuss.elastic.co/t/update-index-type-on-field-it-is-possible/319049 "2022-11-16T09:40:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abkrim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abkrim/32/20217_2.png) [@abkrim](https://discuss.elastic.co/u/abkrim)\
**Post date:** [November 16, 2022, 9:40am UTC](https://discuss.elastic.co/t/update-index-type-on-field-it-is-possible/319049/1 "2022-11-16T09:40:48Z")

</div>

Hi

I need change some fields created with `index` and `doc_values`with `false` for new value true. I'm working with Elasticsearch 8.5

```auto
{
  "analyzers": {
    "mappings": {
      "properties": {
         "pf1":{
           "type": "float",
           "index": false,
           "doc_values": false
          }
....

```

I've tried

```php
$params = [
           'index' => 'analyzers',
           'body' => [
               '_source' => [
                   'enabled' => true
               ],
               'properties' => [
                   'pf1' => [
                       "type" => "float",
                       'index' => true
                   ]
               ]
           ]
       ];

       $response = $client->indices()->putSettings($params);

```

But get error.

```json
{
	"error": {
		"root_cause": [{
			"type": "illegal_argument_exception",
			"reason": "unknown setting [index.properties.pf1.index] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
		}],
		"type": "illegal_argument_exception",
		"reason": "unknown setting [index.properties.pf1.index] please check that any required plugins are installed, or check the breaking changes documentation for removed settings",
		"suppressed": [{
			"type": "illegal_argument_exception",
			"reason": "unknown setting [index.properties.pf1.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
		}]
	},
	"status": 400
}

```

I think that I dont' understand well [Updating Mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html) or if change index and doc\_values are elegibles for update or I need to use another way.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 16, 2022, 10:06pm UTC](https://discuss.elastic.co/t/update-index-type-on-field-it-is-possible/319049/2 "2022-11-16T22:06:32Z")

</div>

You need to reindex this, you cannot just change the mapping parameters.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 14, 2022, 10:07pm UTC](https://discuss.elastic.co/t/update-index-type-on-field-it-is-possible/319049/3 "2022-12-14T22:07:22Z")

</div>

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