Issue with combining synonyms and compound words

I'm trying to combine a synonym token filter and a decompound word token filter.
To create the index, I used something similar to the following.

PUT /test_index
{
  "settings": {
    "index": {
      "analysis": {
        "filter": {
          "synonym": {
            "type": "synonym",
            "synonyms": [
              "militärgeschichte, kriegsgeschichte"
            ]
          },
          "decompound": {
            "type": "dictionary_decompounder",
            "word_list": [
              "geschichte"
            ]
          }
        },
        "analyzer": {
          "my_breaking_analyzer": {
            "type": "custom",
            "tokenizer": "keyword",
            "filter": [
              "decompound",
              "synonym"
            ]
          }
        }
      }
    }
  }
}

However, in ES 6.2 I'm getting the following error.

PUT /test_index
{
  "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 1",
      "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "term: militärgeschichte analyzed to a token (geschichte) with position increment != 1 (got: 0)"
      }
    }
  },
  "status": 400
}

Is this a known issue?

2 Likes

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