# Synonym multi word issue

**URL:** <https://discuss.elastic.co/t/synonym-multi-word-issue/94736>\
**Category:** Elasticsearch\
**Created:** [July 27, 2017, 4:28am UTC](https://discuss.elastic.co/t/synonym-multi-word-issue/94736 "2017-07-27T04:28:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmycho](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jimmycho](https://discuss.elastic.co/u/jimmycho)\
**Post date:** [July 27, 2017, 4:28am UTC](https://discuss.elastic.co/t/synonym-multi-word-issue/94736/1 "2017-07-27T04:28:41Z")

</div>

I drafted are email for synonym multi word issue.

If I want search "lol" to get results has "lol" and "laughing out loud".

My index setting:

> PUT /synonym\_index  
> {  
> "settings": {  
> "analysis" : {  
> "analyzer" : {  
> "my\_analyzer" : {  
> "tokenizer" : "whitespace",  
> "filter" : ["my\_stemmer","synonym"]  
> }  
> },  
> "filter" : {  
> "my\_stemmer" : {  
> "type" : "stemmer",  
> "name" : "english"  
> },  
> "synonym": {  
> "type" : "synonym\_graph",  
> "synonyms" : [  
> "lol, laughing out loud",  
> "universe, cosmos"  
> ` ]  
> }  
> }  
> }  
> }  
> }

input:

> GET synonym\_index/\_analyze?pretty  
> {  
> "analyzer" : "my\_analyzer",  
> "text" : "lol"  
> }

want:

> {  
> "tokens" : [  
> {  
> "token" : "laughing out loud",  
> "start\_offset" : 0,  
> "end\_offset" : 3,  
> "type" : "SYNONYM",  
> "position" : 0  
> },  
> {  
> "token" : "lol",  
> "start\_offset" : 0,  
> "end\_offset" : 3,  
> "type" : "word",  
> "position" : 0,  
> "positionLength" : 3  
> }  
> ]  
> }

But the search results is not what I want. If document have "laughing", "lol", "out" or "loud" will be return. I just want to get have "lol" or "laughing out loud" documents.  
So, what can I need to do? Thanks.

---

<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, 4:28am UTC](https://discuss.elastic.co/t/synonym-multi-word-issue/94736/2 "2017-08-24T04:28:44Z")

</div>

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