# Is there is any way to calculate percentage of search match in ES?

**URL:** https://discuss.elastic.co/t/is-there-is-any-way-to-calculate-percentage-of-search-match-in-es/6754
**Category:** Elasticsearch
**Created:** [February 20, 2012, 7:45am UTC](https://discuss.elastic.co/t/is-there-is-any-way-to-calculate-percentage-of-search-match-in-es/6754 "2012-02-20T07:45:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)
#### Post date: [February 20, 2012, 7:45am UTC](https://discuss.elastic.co/t/is-there-is-any-way-to-calculate-percentage-of-search-match-in-es/6754/1 "2012-02-20T07:45:33Z")

</div>

Hi

One thing is on the basis of max score of the obtained result. For  
example I have priorityMatchAccountName “General Electric” which  
will search on primaryFileIndex. For the result which is obtained,  
there are following two cases.

Case:1 suppose primaryFileIndex contain “General Electric” and other  
one “General Aircraft Engineering “. if want to take decision on the  
basis if max score then in this case we got correct search for  
“General Electric” which found on primaryFileIndex.

Case:2 if primaryFileIndex not contain “General Electric “only  
contain “General Aircraft Engineering “ or other in this case if we  
see on max score value we got search value for “General Electric ”is “  
General Aircraft Engineering ”,which is incorrect search.

So conclusion drawn is that we can’t take a decision on the basis of  
max score.  
My question to you how to calculate percentage of match if we have  
only one single records or even in case we have multiple records?  
I am using query string DSL for search.

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: [July 6, 2017, 3:38am UTC](https://discuss.elastic.co/t/is-there-is-any-way-to-calculate-percentage-of-search-match-in-es/6754/2 "2017-07-06T03:38:48Z")

</div>


