# Rescoring with levenshtein

**URL:** <https://discuss.elastic.co/t/rescoring-with-levenshtein/15848>\
**Category:** Elasticsearch\
**Created:** [February 17, 2014, 2:26pm UTC](https://discuss.elastic.co/t/rescoring-with-levenshtein/15848 "2014-02-17T14:26:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![janek\_sendrowski](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@janek\_sendrowski](https://discuss.elastic.co/u/janek_sendrowski)\
**Post date:** [February 17, 2014, 2:26pm UTC](https://discuss.elastic.co/t/rescoring-with-levenshtein/15848/1 "2014-02-17T14:26:50Z")

</div>

Hi,

I simply want to score the results of my "more\_like\_this\_field" query on my  
own.

Why doesn't this work?

\*{ \*

- 

```
 "query": { *

```

- 

```
       "function_score": { *

```

- 

```
               "more_like_this_field": { *

```

- 

```
                       "test_field": { *

```

- 

```
                               "like_text": "this is a test", *

```

- 

```
                               "min_term_freq" : "0", *

```

- 

```
                               "min_doc_freq": "0" *

```

- 

```
                       } *

```

- 

```
               }, *

```

- 

```
               "functions": [ *

```

- 

```
                       { *

```

- 

```
                               "script_score": { *

```

- 

```
                                       "script": "_score * 2" // just 

```

an example\*

- 

```
                               } *

```

- 

```
                       } *

```

- 

```
               ] *

```

- 

```
        } *

```

- 

```
 } *

```

_}_

Furthermore I like to calculate the score with levenshtein distance. I know  
there is a fuzzy search with levenshtein, but it's limited and also to slow.

I only want to score the top n results with it.

Is that somehow possible?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6c0a9cf9-757b-4c8b-9613-16f9029977d6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6c0a9cf9-757b-4c8b-9613-16f9029977d6%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:49am UTC](https://discuss.elastic.co/t/rescoring-with-levenshtein/15848/2 "2017-07-06T01:49:39Z")

</div>


