# Synonym inconsistent analyze result

**URL:** <https://discuss.elastic.co/t/synonym-inconsistent-analyze-result/86347>\
**Category:** Elasticsearch\
**Created:** [May 19, 2017, 2:46am UTC](https://discuss.elastic.co/t/synonym-inconsistent-analyze-result/86347 "2017-05-19T02:46:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![girlie.tan](https://avatars.discourse-cdn.com/v4/letter/g/85f322/32.png) [@girlie.tan](https://discuss.elastic.co/u/girlie.tan)\
**Post date:** [May 19, 2017, 2:46am UTC](https://discuss.elastic.co/t/synonym-inconsistent-analyze-result/86347/1 "2017-05-19T02:46:53Z")

</div>

hi

I have synonym text file having full-width and half-width digits and Chinese character equivalent of the digits.

example of one row in MySynonym.txt is "7,７,七,柒".

my settings for filter has  
"local\_synonym\_test": {  
"type": "synonym",  
"synonyms\_path": "analysis/MySynonym.txt"  
}

my settings for analyzer has  
"my\_ngram\_analyzer\_test": {  
"type": "custom",  
"tokenizer": "my\_ngram\_tokenizer",  
"filter": [  
"local\_synonym\_test",  
"dash\_as\_alphanum\_fltr"  
]  
}

my settings for tokenizer has  
"my\_ngram\_tokenizer" :{  
"type": "ngram",  
"token\_chars": [  
"letter",  
"digit"  
],  
"min\_gram": "1",  
"max\_gram": "1"  
}

when i execute \_analyze multiple times, i get inconsistent synonym results:  
GET mytestindex/\_analyze  
{  
"analyzer" : "my\_ngram\_analyzer\_test",  
"text" : "7杯"  
}

sometimes the result is RESULT1:  
returns only 7 at position 0.

sometimes the result is RESULT2:  
returns all 7,７,七,柒 at postiion 0.

in Windows environment i get consistent RESULT2, but it is not the case in CentOs environment.

what should i do to make it consistent to return RESULT2 in CentOs environment?

thank you.

---

<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:** [June 16, 2017, 2:47am UTC](https://discuss.elastic.co/t/synonym-inconsistent-analyze-result/86347/2 "2017-06-16T02:47:06Z")

</div>

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