# Search based on percentage of similarity

**URL:** https://discuss.elastic.co/t/search-based-on-percentage-of-similarity/256444
**Category:** Elasticsearch
**Created:** [November 24, 2020, 5:58am UTC](https://discuss.elastic.co/t/search-based-on-percentage-of-similarity/256444 "2020-11-24T05:58:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![iljoaco2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iljoaco2/32/79117_2.png) [@iljoaco2](https://discuss.elastic.co/u/iljoaco2)
#### Post date: [November 24, 2020, 5:58am UTC](https://discuss.elastic.co/t/search-based-on-percentage-of-similarity/256444/1 "2020-11-24T05:58:07Z")

</div>

Hello, I am trying to find one or more names in a field of an index, but I need to indicate two values ​​in the search that reduce the results.  
These two child values:  
Percentage of similarity between searched and found words.  
And percentage between words found and searched.  
Example:  
If I look for the names "Juan Perez"  
and the possible results are:  
Juan perez  
Juan Saúl Pérez  
Perez Roberto  
The first case will have the values ​​100% and 100%  
the second 100% and 66% \* because more words were found than were searched.  
And the third case will be 50% and 50%

The search would be: search for "Juan Perez" 100% 60%

With which I would return the first two results since the last one does not have percentages greater than those required.

I have several doubts:  
The first is if you can add these parameters in the search for two percentage data.  
The second is if I can perform this percentage calculation with some aggregation, script, etc.

I appreciate any collaboration  
regards,  
Joaquin

---

<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: [December 22, 2020, 5:58am UTC](https://discuss.elastic.co/t/search-based-on-percentage-of-similarity/256444/2 "2020-12-22T05:58:07Z")

</div>

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