# When using synonyms, got exception "term: xxx analyzed to a token (xxx) with position increment != 1 (got: 0)

**URL:** <https://discuss.elastic.co/t/when-using-synonyms-got-exception-term-xxx-analyzed-to-a-token-xxx-with-position-increment-1-got-0/299259>\
**Category:** Elasticsearch\
**Created:** [March 9, 2022, 8:53pm UTC](https://discuss.elastic.co/t/when-using-synonyms-got-exception-term-xxx-analyzed-to-a-token-xxx-with-position-increment-1-got-0/299259 "2022-03-09T20:53:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cindy\_X](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cindy_x/32/102835_2.png) [@Cindy\_X](https://discuss.elastic.co/u/Cindy_X)\
**Post date:** [March 9, 2022, 8:53pm UTC](https://discuss.elastic.co/t/when-using-synonyms-got-exception-term-xxx-analyzed-to-a-token-xxx-with-position-increment-1-got-0/299259/1 "2022-03-09T20:53:18Z")

</div>

Hi team,  
We tried to find the root cause of an exception while using synonyms.

This is the synonym filter:

```auto
"japanese_index_synonym": {
            "type": "synonym_graph",
            "lenient": false,
            "synonyms": [
              "kfc,ケンタ,ケンタッキーフライドチキン"
            ]
          },

```

We have ONLY this filter in the analyzer we're using for indexing (I tried using it only for searching analyzer, it throws the same exception.)

This is the error message I see:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "remote_transport_exception",
        "reason": "[BssdTVj][x.x.x.x:9300][indices:admin/create]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "failed to build synonyms",
    "caused_by": {
      "type": "parse_exception",
      "reason": "parse_exception: Invalid synonym rule at line 1",
      "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "term: ケンタッキーフライドチキン analyzed to a token (ケンタッキーフライドチキン) with position increment != 1 (got: 0)"
      }
    }
  },
  "status": 400
}

```

The thing I found about this `ケンタッキーフライドチキン` (KFC's japanese name) is that

```auto
{
      "token": "ケンタッキーフライドチキン",
      "start_offset": 0,
      "end_offset": 13,
      "type": "word",
      "position": 0,
      "positionLength": 2
    }

```

because it's `名詞-固有名詞-組織` (a specific company name).

How shall we resolve this exception? Thank you so much!

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 17, 2022, 10:06am UTC](https://discuss.elastic.co/t/when-using-synonyms-got-exception-term-xxx-analyzed-to-a-token-xxx-with-position-increment-1-got-0/299259/2 "2022-03-17T10:06:18Z")

</div>

Can you create a full reproduction including index and mapping creation for this on Elasticsearch 8.1.0 using a few curl commands/Kibana Dev Tools - and optionally create a bug report out of that (which I am happy to do as well). That would allow for further debugging.

---

<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:** [April 14, 2022, 10:06am UTC](https://discuss.elastic.co/t/when-using-synonyms-got-exception-term-xxx-analyzed-to-a-token-xxx-with-position-increment-1-got-0/299259/3 "2022-04-14T10:06:22Z")

</div>

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