# Score based on Levenshtein distance in the results

**URL:** <https://discuss.elastic.co/t/score-based-on-levenshtein-distance-in-the-results/88024>\
**Category:** Elasticsearch\
**Created:** [June 2, 2017, 7:44am UTC](https://discuss.elastic.co/t/score-based-on-levenshtein-distance-in-the-results/88024 "2017-06-02T07:44:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaelco](https://avatars.discourse-cdn.com/v4/letter/y/54ee81/32.png) [@yaelco](https://discuss.elastic.co/u/yaelco)\
**Post date:** [June 2, 2017, 7:44am UTC](https://discuss.elastic.co/t/score-based-on-levenshtein-distance-in-the-results/88024/1 "2017-06-02T07:44:42Z")

</div>

Is there a more efficient way to get the Levenshtein-distance similarity as the score (based on 1 field value) rather than using match query and computing it in the application code after getting the results from Elasticsearch?  
I couldn't find a function\_score or OOB script that returns the score based on just the Levenshtein similarity eliminating the TF/IDF though I believe it's already computed during the search.

---

<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 30, 2017, 7:45am UTC](https://discuss.elastic.co/t/score-based-on-levenshtein-distance-in-the-results/88024/2 "2017-06-30T07:45:20Z")

</div>

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