Defying synonyms for roman numbers doesn't seem to work

Hi,

I've been trying to set up roman numbers synonyms the following way:

PUT testing_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_custome_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "roman_letters_synonyms"
          ]
        }
      },
      "filter": {
        "roman_letters_synonyms": {
          "type": "synonym_graph",
          "synonyms": [
            "5 => v"
          ]
        }
      }
    }
  }
}


POST testing_index/_doc
{
  "name": "Grand Theft Auto V"
}

GET testing_index/_search 
{
  "query": {
    "match_phrase": {
      "name": "5"
    }
  }
}

But the last queue doesn't return the expected result.
What am I doing wrong here?

Have you set my_custome_analyzer as the analyzer of the "name" field? You would do that in your mappings. Please post them if you did and are still experiencing this problem, its easier to re-create things that way.

I see, I thought that by defying it there it would be set automaticly.
I set it as the index default and it fixed the problem.
Thank you

1 Like

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