# Problems with synonyms in Elastic 6.2

**URL:** <https://discuss.elastic.co/t/problems-with-synonyms-in-elastic-6-2/118820>\
**Category:** Elasticsearch\
**Created:** [February 7, 2018, 11:14am UTC](https://discuss.elastic.co/t/problems-with-synonyms-in-elastic-6-2/118820 "2018-02-07T11:14:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karolinebryn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karolinebryn/32/17095_2.png) [@Karolinebryn](https://discuss.elastic.co/u/Karolinebryn)\
**Post date:** [February 7, 2018, 11:14am UTC](https://discuss.elastic.co/t/problems-with-synonyms-in-elastic-6-2/118820/1 "2018-02-07T11:14:15Z")

</div>

I have an index in ES 5.6 that I want to move to ES 6.2, but I have some problems when trying to create this index in ES 6.2.

```
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "failed to build synonyms"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "failed to build synonyms",
    "caused_by": {
      "type": "parse_exception",
      "reason": "Invalid synonym rule at line 32",
      "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "term: helse miljø og sikkerhet analyzed to a token (sikker) with position increment != 1 (got: 2)"
      }
    }
  },
  "status": 400
}

```

This is my synonym filter:

```
	"synonym_no": {
          "type": "synonym",
          "synonyms": [
		    ...
                "hms, helse miljø og sikkerhet",
                ...
            ]
        }

```

I have a lot more synonyms than this, but why is this causing an issue? It worked fine in 5.6.

---

<div class="post-metadata">

**Author:** ![moy2010](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moy2010/32/22403_2.png) [@moy2010](https://discuss.elastic.co/u/moy2010)\
**Post date:** [February 7, 2018, 6:05pm UTC](https://discuss.elastic.co/t/problems-with-synonyms-in-elastic-6-2/118820/2 "2018-02-07T18:05:22Z")

</div>

Hi, Karolinebryn. It seems like a stemmer issue to me, try to define the synonyms analyzer's tokenizer to "whitespace" and see if that helps.

---

<div class="post-metadata">

**Author:** ![moy2010](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moy2010/32/22403_2.png) [@moy2010](https://discuss.elastic.co/u/moy2010)\
**Post date:** [February 7, 2018, 6:07pm UTC](https://discuss.elastic.co/t/problems-with-synonyms-in-elastic-6-2/118820/3 "2018-02-07T18:07:56Z")

</div>

Another thing to try would be to use the [Synonym Graph Token Filter](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-synonym-graph-tokenfilter.html) instead, since this one respects the token positions.

---

<div class="post-metadata">

**Author:** ![Karolinebryn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karolinebryn/32/17095_2.png) [@Karolinebryn](https://discuss.elastic.co/u/Karolinebryn)\
**Post date:** [February 12, 2018, 8:49am UTC](https://discuss.elastic.co/t/problems-with-synonyms-in-elastic-6-2/118820/4 "2018-02-12T08:49:38Z")

</div>

Yes! I will try this when I have the time 🙂

---

<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:** [March 12, 2018, 8:49am UTC](https://discuss.elastic.co/t/problems-with-synonyms-in-elastic-6-2/118820/5 "2018-03-12T08:49:39Z")

</div>

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