# Custom score for fuzzy matching based on Levenshtein distance score

**URL:** <https://discuss.elastic.co/t/custom-score-for-fuzzy-matching-based-on-levenshtein-distance-score/125544>\
**Category:** Elasticsearch\
**Created:** [March 26, 2018, 5:43am UTC](https://discuss.elastic.co/t/custom-score-for-fuzzy-matching-based-on-levenshtein-distance-score/125544 "2018-03-26T05:43:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [March 28, 2018, 2:29pm UTC](https://discuss.elastic.co/t/custom-score-for-fuzzy-matching-based-on-levenshtein-distance-score/125544/4 "2018-03-28T14:29:04Z")

</div>

There is no out of the box functionality that gives you a similarity score like that, as far as I know.

You'd have to implement this yourself as a script that you could use as a [script\_score function in the function score query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-script-score) (which is likely going to be very slow). A better way could be to [implement this as a Java plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/6.2/plugin-authors.html).

Either way, you'll be looking at writing some code, unless someone else on this forum has a better idea.

---

_[View the full topic](https://discuss.elastic.co/t/custom-score-for-fuzzy-matching-based-on-levenshtein-distance-score/125544)._
