# Custom relevancy

**URL:** <https://discuss.elastic.co/t/custom-relevancy/91648>\
**Category:** Elasticsearch\
**Created:** [July 3, 2017, 2:21pm UTC](https://discuss.elastic.co/t/custom-relevancy/91648 "2017-07-03T14:21:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martingrayson](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@martingrayson](https://discuss.elastic.co/u/martingrayson)\
**Post date:** [July 3, 2017, 2:21pm UTC](https://discuss.elastic.co/t/custom-relevancy/91648/1 "2017-07-03T14:21:41Z")

</div>

I'm trying to build a process to merge a bunch of records. I have an index of music artists that is not throughly cleansed, I'd like to build a process that loops over each artist and finds similarly spelt ones. The plan is to take these relationships and allow for a user to review them and potentially say "beyonce" and "beyoncé" are the same artist (bad example).

I'm having trouble doing this using the \_score value due to inverse term frequency. e.g. If I search for "A midsummer nights dream" on the following documents.  
A MIDSUMMER NIGHT'S DREAM  
A MIDSUMMER NIGHTS DREAM  
A MIDSUMMER NIGHT´S DREAM  
A MIDSUMMER'S NIGHT'S DREAM  
A NARRATED MIDSUMMER NIGHT'S DREAM

The "NARRATED" version appears higher than some of the other results due to the rarity of "narrated".  
My query looks like this:

```
GET artists/artist/_search
{
  "query": {
    "match": {
      "name": {
        "query": "A MIDSUMMER NIGHTS DREAM",
        "fuzziness": 3
      }
    }
  }
}

```

I'd like to base the score on perhaps the number of tokens that match the input query, is such a thing possible? I cant find much in the documentation.

---

<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 31, 2017, 2:21pm UTC](https://discuss.elastic.co/t/custom-relevancy/91648/2 "2017-07-31T14:21:50Z")

</div>

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