# "Strange" behaviour multimatch with fuzziness

**URL:** https://discuss.elastic.co/t/strange-behaviour-multimatch-with-fuzziness/98867
**Category:** Elasticsearch
**Created:** [August 30, 2017, 2:28pm UTC](https://discuss.elastic.co/t/strange-behaviour-multimatch-with-fuzziness/98867 "2017-08-30T14:28:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![barry1](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@barry1](https://discuss.elastic.co/u/barry1)
#### Post date: [August 30, 2017, 2:28pm UTC](https://discuss.elastic.co/t/strange-behaviour-multimatch-with-fuzziness/98867/1 "2017-08-30T14:28:21Z")

</div>

So I have 3 documents with 2 fields: title and brand

1. Title: Björn Borg R400 Low SNB schoenen heren marine/groen/wit, Brand: Björn Borg
2. Title: Baby Born Schoenen 2-Pack Assorti, Brand: Baby Born
3. Title: Born In The Echoes, Brand: Virgin Records

Now I'm doing a multi\_match query on this with the term `Björn Borg Schoenen` and a weight of 2.0 for the title and 5.0 for the brand

```
GET /my_index/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "multi_match": {
            "query": "bjorn borg schoenen",
            "fields": [
              "title^5.0",
              "brand^2.0"
            ],
            "type": "best_fields",
            "operator": "and",
            "fuzziness": "auto"
          }
        }
      ]
    }
  }
}

```

Now the result that I would expect is the order they are in as above 1, 2 and 3. But I'm getting the results back in the order 2, 3 and 1.

The only thing I can think of why this is happening is because the word `Born` is 1 levenshtein distance away from `Bjorn` as well as from `Borg` so it matches double and the word `Schoenen` also is in the title of the 2nd document. And for the same double matching reason plus `Born` is 25% (double is 50%) of the title in the 3rd document versus 3 words in 10 equals 30% in the 1st document. But ofcourse this is not the behaviour that I would expect, let alone the behaviour that I want.

Can anyone shed a light on this? Or even provide a way to "fix" this?

---

<div class="post-metadata">

### Author: ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)
#### Post date: [August 30, 2017, 2:34pm UTC](https://discuss.elastic.co/t/strange-behaviour-multimatch-with-fuzziness/98867/2 "2017-08-30T14:34:52Z")

</div>

Use the "explain" api to get the raw stats.  
My guess is it is down to IDF of terms selected. multi-match has a tendency to reward the most bizarre context for a word when there's matches in multiple fields because rare=good.  
Try the "cross\_fields" type and remove the boosts on the field names. Cross\_fields uses some subtle boosting tricks that ensure a match for a word in the most-likely field will score higher than the least-likely field and these tweaks are undone if you apply field-level boosts for all words.

---

<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: [September 27, 2017, 2:35pm UTC](https://discuss.elastic.co/t/strange-behaviour-multimatch-with-fuzziness/98867/3 "2017-09-27T14:35:22Z")

</div>

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