# How to update ElasticSearch search\_analyzer mapping without conflict on analyzer?

**URL:** <https://discuss.elastic.co/t/how-to-update-elasticsearch-search-analyzer-mapping-without-conflict-on-analyzer/236533>\
**Category:** Elasticsearch\
**Created:** [June 10, 2020, 3:28pm UTC](https://discuss.elastic.co/t/how-to-update-elasticsearch-search-analyzer-mapping-without-conflict-on-analyzer/236533 "2020-06-10T15:28:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![waynebloss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waynebloss/32/70273_2.png) [@waynebloss](https://discuss.elastic.co/u/waynebloss)\
**Post date:** [June 10, 2020, 3:28pm UTC](https://discuss.elastic.co/t/how-to-update-elasticsearch-search-analyzer-mapping-without-conflict-on-analyzer/236533/1 "2020-06-10T15:28:45Z")

</div>

Also asked on [StackOverflow](https://stackoverflow.com/questions/62307234/how-to-update-elasticsearch-search-analyzer-mapping-without-conflict-on-analyzer)

I'm using version 7.7 of ElasticSearch, LogStash and Kibana and trying to update an index mapping for a field is resulting in one of 2 errors:

- `mapper_parsing_exception: analyzer on field [title] must be set when search_analyzer is set`
- `illegal_argument_exception: Mapper for [title] conflicts with existing mapping:\n[mapper [title] has different [analyzer]]`

Here is the operation that I am attempting. If I remove `"analyzer": "standard"`, I get the first error. If I leave it in, I get the second error.

```auto
PUT /my_index/_mapping
{
  "properties": {
    "title": {
      "type": "text",
      "analyzer": "standard",
      "search_analyzer": "synonyms"
    }
  }
}

```

However when I get the mapping with `GET /my_index/_mapping`, I don't see any analyzer defined:

```auto
"title" : {
  "type" : "text",
  "fields" : {
    "keyword" : {
      "type" : "keyword",
      "ignore_above" : 256
    }
  }
},

```

### Extra Info

Here is how I setup the "synonyms" search analyzer, but I don't think that is relevant:

```auto
POST /my_index/_close
PUT /my_index/_settings
{
  "index": {
    "analysis": {
      "analyzer": {
        "synonyms": {
          "tokenizer": "whitespace",
          "filter": [
            "lowercase",
            "the_synonyms"
          ]
        }
      },
      "filter": {
        "the_synonyms": {
          "type": "synonym",
          "synonyms_path": "the_synonyms.txt",
          "updateable": true
        }
      }
    }
  }
}
POST /my_index/_open

```

---

<div class="post-metadata">

**Author:** ![waynebloss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waynebloss/32/70273_2.png) [@waynebloss](https://discuss.elastic.co/u/waynebloss)\
**Post date:** [June 11, 2020, 8:27pm UTC](https://discuss.elastic.co/t/how-to-update-elasticsearch-search-analyzer-mapping-without-conflict-on-analyzer/236533/2 "2020-06-11T20:27:35Z")

</div>

The following works. Not sure there are any implications of doing it this way. I don't think so, but I could not find any documentation on it either, other than the documentation that states that the `standard` analyzer is the default analyzer. I essentially found this answer by guessing.

```auto
PUT /my_index/_mapping
{
  "properties": {
    "title": {
      "type": "text",
      "analyzer": "default",
      "search_analyzer": "synonyms"
    }
  }
}

```

---

<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:** [July 9, 2020, 8:33pm UTC](https://discuss.elastic.co/t/how-to-update-elasticsearch-search-analyzer-mapping-without-conflict-on-analyzer/236533/3 "2020-07-09T20:33:55Z")

</div>

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