# Illegal\_argument\_exception - setup of analyzer

**URL:** <https://discuss.elastic.co/t/illegal-argument-exception-setup-of-analyzer/122546>\
**Category:** Elasticsearch\
**Created:** [March 5, 2018, 3:13pm UTC](https://discuss.elastic.co/t/illegal-argument-exception-setup-of-analyzer/122546 "2018-03-05T15:13:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfoldbjerg](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@mfoldbjerg](https://discuss.elastic.co/u/mfoldbjerg)\
**Post date:** [March 5, 2018, 3:13pm UTC](https://discuss.elastic.co/t/illegal-argument-exception-setup-of-analyzer/122546/1 "2018-03-05T15:13:25Z")

</div>

Hi,

We'we been using the following analyzer setup for ages:

"analysis": {  
"char\_filter": {  
"danish\_char\_mapping": {  
"type": "mapping",  
"mappings": [  
"\u00C0 =\> A",  
"\u00C1 =\> A",  
"\u00C2 =\> A",  
"\u00C3 =\> A",  
"\u00C4 =\> A",  
"\u00C5 =\> AA",  
"\u00C6 =\> AE",  
"\u00C7 =\> C",  
"\u00C8 =\> E",  
"\u00C9 =\> E",  
"\u00CA =\> E",  
"\u00CB =\> E",  
"\u00CC =\> I",  
"\u00CD =\> I",  
"\u00CE =\> I",  
"\u00CF =\> I",  
"\u0132 =\> IJ",  
"\u00D0 =\> D",  
"\u00D1 =\> N",  
"\u00D2 =\> O",  
"\u00D3 =\> O",  
"\u00D4 =\> O",  
"\u00D5 =\> O",  
"\u00D6 =\> O",  
"\u00D8 =\> OE",  
"\u0152 =\> OE",  
"\u00DE =\> TH",  
"\u00D9 =\> U",  
"\u00DA =\> U",  
"\u00DB =\> U",  
"\u00DC =\> U",  
"\u00DD =\> Y",  
"\u0178 =\> Y",  
"\u00E0 =\> a",  
"\u00E1 =\> a",  
"\u00E2 =\> a",  
"\u00E3 =\> a",  
"\u00E4 =\> a",  
"\u00E5 =\> aa",  
"\u00E6 =\> ae",  
"\u00E7 =\> c",  
"\u00E8 =\> e",  
"\u00E9 =\> e",  
"\u00EA =\> e",  
"\u00EB =\> e",  
"\u00EC =\> i",  
"\u00ED =\> i",  
"\u00EE =\> i",  
"\u00EF =\> i",  
"\u0133 =\> ij",  
"\u00F0 =\> d",  
"\u00F1 =\> n",  
"\u00F2 =\> o",  
"\u00F3 =\> o",  
"\u00F4 =\> o",  
"\u00F5 =\> o",  
"\u00F6 =\> o",  
"\u00F8 =\> oe",  
"\u0153 =\> oe",  
"\u00DF =\> ss",  
"\u00FE =\> th",  
"\u00F9 =\> u",  
"\u00FA =\> u",  
"\u00FB =\> u",  
"\u00FC =\> u",  
"\u00FD =\> y",  
"\u00FF =\> y",  
"\uFB00 =\> ff",  
"\uFB01 =\> fi",  
"\uFB02 =\> fl",  
"\uFB03 =\> ffi",  
"\uFB04 =\> ffl",  
"\uFB05 =\> ft",  
"\uFB06 =\> st"  
]  
}  
},  
"analyzer": {  
"default": {  
"type": "custom",  
"tokenizer": "whitespace",  
"filter": [  
"lowercase",  
"danish\_synonyms\_pre\_token",  
"preserveSelskabsForm",  
"stop\_characters",  
"danish\_synonyms\_post\_token"  
],  
"char\_filter": ["danish\_char\_mapping"]  
},  
"danish\_ducet": {  
"tokenizer": "keyword",  
"filter": ["dansk\_sortering"]  
},  
"suggester": {  
"tokenizer": "standard",  
"filter": ["stop\_characters", "lowercase", "shingles"]  
}  
},  
"filter": {  
"preserveForwardSlash": {  
"type": "word\_delimiter",  
"type\_table": ["/ =\> ALPHA"]  
},  
"shingles": {  
"type": "shingle",  
"min\_shingle\_size": 2,  
"max\_shingle\_size": 3  
},  
"stop\_characters": {  
"type": "stop",  
"stopwords": [  
"-",  
"!",  
"#",  
"\*",  
"$",  
"?",  
"+",  
"%",  
"=",  
"£",  
":",  
".",  
",",  
"_",  
";",  
"og"  
]  
},  
"danish\_synonyms\_post\_token": {  
"type": "synonym",  
"synonyms": [  
"1,en",  
"2,to",  
"gl,gammel",  
"ll,lille",  
"ndr,nordre",  
"nr,noerre",  
"sdr,soender",  
"skt,sankt",  
"st,store",  
"v,vester",  
"oe,oester",  
"dr,doktor",  
"hf,haveforening",  
"a,alle",  
"boul,boulevard",  
"g,gade",  
"kr,kirke",  
"kvt,kvarter",  
"pas,passage",  
"pl,plads",  
"str,straede",  
"t,torv",  
"v,vej",  
"vg,vaenge",  
"borgm,borgmester",  
"prs,prinsesse",  
"dronn,dronning",  
"kprs,kronprinsesse",  
"chr,christian",  
"edv,edvard",  
"fr,frederik",  
"johs,johannes",  
"vilh,vilhelm",  
"sverrigsgade,sverigesgade",  
"&,og",  
"i/s,interessentskab",  
"a/s,aktieselskab",  
"k/s,kommanditselskab"  
]  
},  
"danish\_synonyms\_pre\_token": {  
"synonyms": [  
"a7s,a/s",  
"i7s,i/s",  
"k7s,k/s"  
],  
"type": "synonym"  
},  
"dansk\_sortering": {  
"type": "icu\_collation",  
"language": "da",  
"country": "DK"  
},  
"preserveSelskabsForm": {  
"protected\_words": [  
"a7s",  
"a/s",  
"i7s",  
"i/s",  
"k7s",  
"k/s"  
],  
"type": "word\_delimiter",  
"type\_table": [  
"_ =\> ALPHANUM"  
],  
"split\_on\_numerics": false  
}  
}  
}

And it has worked under the 1.x series, 2.x series and 5.x series. But now when I try to build a new index under ES 6.2.2, specifying the above analyzer setup in the settings section, I receive the following error, which I don't understand:

{  
"error": {  
"caused\_by": {  
"caused\_by": {  
"reason": "term: i/s analyzed to a token (i7s) with position increment != 1 (got: 0)",  
"type": "illegal\_argument\_exception"  
},  
"reason": "Invalid synonym rule at line 35",  
"type": "parse\_exception"  
},  
"reason": "failed to build synonyms",  
"root\_cause": [  
{  
"reason": "failed to build synonyms",  
"type": "illegal\_argument\_exception"  
}  
],  
"type": "illegal\_argument\_exception"  
},  
"status": 400  
}

Hope somebody can enlighten me.

Regards,  
Michael

---

<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 2, 2018, 3:26pm UTC](https://discuss.elastic.co/t/illegal-argument-exception-setup-of-analyzer/122546/2 "2018-04-02T15:26:15Z")

</div>

Closed on April 2, 2018, 3:26pm UTC

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