Problems with synonyms in Elastic 6.2


(Karoline Brynildsen) #1

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.


(Moises Garcia Marquez) #2

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.


(Moises Garcia Marquez) #3

Another thing to try would be to use the Synonym Graph Token Filter instead, since this one respects the token positions.


(Karoline Brynildsen) #4

Yes! I will try this when I have the time :slight_smile:


(system) #5

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