# Elasticsearch or Lucene synonyms (wordnet) Bug

**URL:** <https://discuss.elastic.co/t/elasticsearch-or-lucene-synonyms-wordnet-bug/112114>\
**Category:** Elasticsearch\
**Created:** [December 17, 2017, 8:06am UTC](https://discuss.elastic.co/t/elasticsearch-or-lucene-synonyms-wordnet-bug/112114 "2017-12-17T08:06:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![svarup](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@svarup](https://discuss.elastic.co/u/svarup)\
**Post date:** [December 17, 2017, 8:06am UTC](https://discuss.elastic.co/t/elasticsearch-or-lucene-synonyms-wordnet-bug/112114/1 "2017-12-17T08:06:29Z")

</div>

when i was using synonym filter in elasticsearch 5.0 it was run perfect but i just upgrade to elasticsearch 6.0.1 and it gives me error i use php elasticsearch client and wordnet synonyms.

`Fatal error: Uncaught Elasticsearch\Common\Exceptions\BadRequest400Exception: {"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 109","caused_by":{"type":"illegal_argument_exception","reason":"term: course of action analyzed to a token with posinc != 1"}}},"status":400}`

i think that error from lucene.

> <https://github.com/apache/lucene-solr/blob/master/lucene/analysis/common/src/java/org/apache/lucene/analysis/synonym/SolrSynonymParser.java#L72>

---

<div class="post-metadata">

**Author:** ![svarup](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@svarup](https://discuss.elastic.co/u/svarup)\
**Post date:** [December 17, 2017, 9:42am UTC](https://discuss.elastic.co/t/elasticsearch-or-lucene-synonyms-wordnet-bug/112114/2 "2017-12-17T09:42:59Z")

</div>

i also use `stopFilter` and when i use `synonymn` filter befor the `stopFilter` then it will solve my issue.

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [December 18, 2017, 3:23am UTC](https://discuss.elastic.co/t/elasticsearch-or-lucene-synonyms-wordnet-bug/112114/3 "2017-12-18T03:23:47Z")

</div>

Could you share your mappings and settings?

---

<div class="post-metadata">

**Author:** ![svarup](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@svarup](https://discuss.elastic.co/u/svarup)\
**Post date:** [December 20, 2017, 5:06pm UTC](https://discuss.elastic.co/t/elasticsearch-or-lucene-synonyms-wordnet-bug/112114/4 "2017-12-20T17:06:10Z")

</div>

Yes here it is the mapping of synonyms

```auto
icu_synonym' => [
'type' => 'custom',
'char_filter'	=> ['html_strip', 'quotes'],
'tokenizer'	=> 'icu_tokenizer',
'filter'	=> ['lowercase', 'icu_normalizer', 'synonym', 'en_stop_filter', 'en_stem_filter', 'icu_folding'],
],
```

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [December 25, 2017, 11:16pm UTC](https://discuss.elastic.co/t/elasticsearch-or-lucene-synonyms-wordnet-bug/112114/5 "2017-12-25T23:16:36Z")

</div>

Can you also share each tokenizer/token filter/ char filter settings?

---

<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:** [January 22, 2018, 11:16pm UTC](https://discuss.elastic.co/t/elasticsearch-or-lucene-synonyms-wordnet-bug/112114/6 "2018-01-22T23:16:53Z")

</div>

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