# Elasticsearch version 5.1 multimatch minimum should match

**URL:** <https://discuss.elastic.co/t/elasticsearch-version-5-1-multimatch-minimum-should-match/89952>\
**Category:** Elasticsearch\
**Created:** [June 19, 2017, 2:40pm UTC](https://discuss.elastic.co/t/elasticsearch-version-5-1-multimatch-minimum-should-match/89952 "2017-06-19T14:40:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![legend\_blue](https://avatars.discourse-cdn.com/v4/letter/l/919ad9/32.png) [@legend\_blue](https://discuss.elastic.co/u/legend_blue)\
**Post date:** [June 19, 2017, 2:40pm UTC](https://discuss.elastic.co/t/elasticsearch-version-5-1-multimatch-minimum-should-match/89952/1 "2017-06-19T14:40:42Z")

</div>

upgrade elasticsearch 1.7.5 to version 5.1 the search query result and scores changed. Both version have same settings and mappings, everything is the same.

`

```
 {
  
  "_source": {

          "includes": [

             "productName"

               ]
         },
    "size": 100, 
   "query": {
      "function_score": {
         "query": {
            "multi_match": {
               "type": "best_fields",
               "query": "karaf",
               "minimum_should_match": "100%",
               "operator": "and",
               "fields": [
                  "productName.standard"
               ]
            }
         }
      }
   }
}`

```

Version 1.7.5 result : [https://gist.github.com/escobar4400/e45062e0e06ab251e190e2acf93f62ee](https://gist.github.com/escobar4400/e45062e0e06ab251e190e2acf93f62ee)

Version 5.1 result: [https://gist.github.com/escobar4400/4abbe0b4760990015a632fbfa168df90](https://gist.github.com/escobar4400/4abbe0b4760990015a632fbfa168df90)

in version 1.7 when change minimum\_should\_match =50% ,the result document increase , but in 5.1 nothing change minimum\_should\_match =1% and minimum\_should\_match =100% same result count and same document.

mapping :

```
 {
"test-index": {
	"mappings": {
		"product": {
			"properties": {
				"productName": {
					"type": "keyword",
					"fields": {
						"standard": {
							"type": "text",
							"similarity": "classic",
							"analyzer": "auto_complete"
						}
					}
				},
				"seoDescription": {
					"type": "keyword",
					"fields": {
						"standard": {
							"type": "text",
							"similarity": "classic",
							"analyzer": "auto_complete"
						}
					}
				},
				"seoKeyword": {
					"type": "keyword",
					"fields": {
						"standard": {
							"type": "text",
							"similarity": "classic",
							"analyzer": "auto_complete"
						}
					}
				},
				"variantName": {
					"type": "keyword",
					"fields": {
						"standard": {
							"type": "text",
							"similarity": "classic",
							"analyzer": "auto_complete"
						}
					}
				}
			}
		}
	}
}
}

```

Setting :

```
 {
    "test-index": {
     "settings": {
        "index": {
        "analysis": {
           "filter": {
              "edge_n_gram": {
                 "type": "edge_ngram",
                 "min_gram": "3",
                 "max_gram": "10"
              },
              "synonym_filter": {
                 "type": "synonym",
                 "synonyms": [
                    ""
                 ]
              },
              "nGram": {
                 "type": "ngram",
                 "min_gram": "3",
                 "max_gram": "10"
              },
              "tr_snowball": {
                 "type": "snowball",
                 "language": "Turkish"
              }
           },
           "analyzer": {
              "auto_complete": {
                 "filter": [
                    "lowercase",
                    "asciifolding",
                    "edge_n_gram"
                 ],
                 "char_filter": [
                    "html_escape",
                    "quotes"
                 ],
                 "type": "custom",
                 "tokenizer": "whitespace"
              }
           },
           "char_filter": {
              "html_escape": {
                 "type": "html_strip"
              },
              "quotes": {
                 "type": "mapping",
                 "mappings": [
                    "'=>"
                 ]
              }
           }
        },
        "number_of_replicas": "1"
        
     }
  }
 }
}
```

---

<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 17, 2017, 2:40pm UTC](https://discuss.elastic.co/t/elasticsearch-version-5-1-multimatch-minimum-should-match/89952/2 "2017-07-17T14:40:49Z")

</div>

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