# Match synonyms and match exact word get different scores

**URL:** <https://discuss.elastic.co/t/match-synonyms-and-match-exact-word-get-different-scores/165329>\
**Category:** Elasticsearch\
**Created:** [January 23, 2019, 4:13am UTC](https://discuss.elastic.co/t/match-synonyms-and-match-exact-word-get-different-scores/165329 "2019-01-23T04:13:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heather\_Lau](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/heather_lau/32/40114_2.png) [@Heather\_Lau](https://discuss.elastic.co/u/Heather_Lau)\
**Post date:** [January 23, 2019, 4:13am UTC](https://discuss.elastic.co/t/match-synonyms-and-match-exact-word-get-different-scores/165329/1 "2019-01-23T04:13:16Z")

</div>

Hi, I created a multiple analyzers for keyword field and I want to do the following:

1. If the words matched keyword.exact, the score of the words will multiply by 1.2
2. If some other words matched keyword.synonym, the score of the words will multiply by 0.7
3. Get the sum of above scores

Example:  
doc : hi, how are you  
query: hello, how are you  
keyword.exact should match: how are you  
keyword.synonym should match: hello =\> hi

But now the words that matched keyword.exact will matched in keyword.synonym too..  
keyword.exact matched: how are you  
keyword.synonym matched: hello =\> hi + how are you

**My mapping:**  
"keyword": {  
"type": "text",  
"fields": {  
"exact": { "type": "text", "analyzer": "ik" },  
"synonym": { "type": "text", "analyzer": "ik\_synonym" }  
}}

**My query:**  
'query' : { 'bool': {  
'should': [  
{ 'match' : { 'keyword.exact': { 'query': text, 'boost': 1.2 }}},  
{ 'match' : { 'keyword.synonym': { 'query': text, 'boost': 0.7 }}}  
]  
}}

Can anyone help me?  
Best regards

---

<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:** [February 20, 2019, 4:13am UTC](https://discuss.elastic.co/t/match-synonyms-and-match-exact-word-get-different-scores/165329/2 "2019-02-20T04:13:16Z")

</div>

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