# Synonyms not working with diacritic chars

**URL:** <https://discuss.elastic.co/t/synonyms-not-working-with-diacritic-chars/94623>\
**Category:** Elasticsearch\
**Created:** [July 26, 2017, 11:05am UTC](https://discuss.elastic.co/t/synonyms-not-working-with-diacritic-chars/94623 "2017-07-26T11:05:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wiert](https://avatars.discourse-cdn.com/v4/letter/w/b4bc9f/32.png) [@wiert](https://discuss.elastic.co/u/wiert)\
**Post date:** [July 26, 2017, 11:05am UTC](https://discuss.elastic.co/t/synonyms-not-working-with-diacritic-chars/94623/1 "2017-07-26T11:05:03Z")

</div>

Hi,

I'm using ES 5.5 and I'm unable to put some words into the synonyms file (støvmaske, buntebånd, etc).

When putting the filter

```
{
	"settings": {
		"analysis": {
			"analyzer": {
				"synonym_analyzer": {
					"type": "custom",
					"filter": ["lowercase", "asciifolding", "trim", "my_synonyms"],
					"tokenizer" : "standard"
				}
			},
			"filter": {
				"my_synonyms": {
					"type": "synonym",
					"synonyms_path": "analysis/Norway/synonyms.txt",
					"tokenizer" : "standard"
				}
			}
		}
	}
}

```

I'm getting the response:

```
{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "failed to build synonyms"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "failed to build synonyms",
        "caused_by": {
            "type": "malformed_input_exception",
            "reason": "Input length = 1"
        }
    },
    "status": 400
}

```

Those settings are fine when synonym file contains "standard" words.

What am I missing?

---

<div class="post-metadata">

**Author:** ![wiert](https://avatars.discourse-cdn.com/v4/letter/w/b4bc9f/32.png) [@wiert](https://discuss.elastic.co/u/wiert)\
**Post date:** [July 27, 2017, 10:20am UTC](https://discuss.elastic.co/t/synonyms-not-working-with-diacritic-chars/94623/2 "2017-07-27T10:20:47Z")

</div>

It turned out that I needed to change a file encoding to UTF-8 and it started working correctly.

---

<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:** [August 24, 2017, 10:21am UTC](https://discuss.elastic.co/t/synonyms-not-working-with-diacritic-chars/94623/3 "2017-08-24T10:21:19Z")

</div>

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