# Minimum\_should\_match not working as expected

**URL:** <https://discuss.elastic.co/t/minimum-should-match-not-working-as-expected/190775>\
**Category:** Elasticsearch\
**Created:** [July 16, 2019, 3:11pm UTC](https://discuss.elastic.co/t/minimum-should-match-not-working-as-expected/190775 "2019-07-16T15:11:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erhan\_Karabulut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erhan_karabulut/32/45057_2.png) [@Erhan\_Karabulut](https://discuss.elastic.co/u/Erhan_Karabulut)\
**Post date:** [July 16, 2019, 3:11pm UTC](https://discuss.elastic.co/t/minimum-should-match-not-working-as-expected/190775/1 "2019-07-16T15:11:42Z")

</div>

Hello All,

Match Query:

```auto
    {
   "query":{  
      "bool":{  
         "should":[  
            {  
               "match":{  
                  "nAME":{  
                     "analyzer":"my_fuzzy_analyzer",
                     "fuzziness":"AUTO:1,4",
                     "fuzzy_transpositions":true,
                     "max_expansions":2147483647,
                     "minimum_should_match":-1,
                     "operator":"and",
                     "prefix_length":3,
                     "query":"SHENZHEN LONGTANUO LOGISTICS C "
                  }
               }
            }
         ]
      }
   }
}

```

Expected Results:

```auto
SHENZHEN LONGTANUO LOGISTICS C                                  
SHENZHEN LUCKY LOGISTICS LTD.                                         
SHENZHEN UNIQUE LOGISTICS INTERNATIONAL LTD.                 

```

Note : International - ltd - logistics are stopword ,

But only get result :

```auto
SHENZHEN LONGTANUO LOGISTICS C     

```

I couldnt understand why. Beause every text have -1 match

Analyzer :

```auto
{
    "atlas.zcustomer": {
        "settings": {
            "index": {
                "number_of_shards": "5",
                "provided_name": "atlas.zcustomer",
                "creation_date": "1563288936515",
                "analysis": {
                    "filter": {
                        "my_stop_word": {
                            "type": "stop",
                            "stopwords": [
                                "ith",
                                "ihr",
                                "san",
                                "tic",
                                "ltd",
                                "de",
                                "la",
                                "s",
                                "a",
                                "inc",
                                "logistics",
                                "international"
                            ]
                        },
                        "my_length": {
                            "type": "length",
                            "min": "3"
                        }
                    },
                    "analyzer": {
                        "my_fuzzy_analyzer": {
                            "filter": [
                                "my_length",
                                "lowercase",
                                "my_stop_word"
                            ],
                            "type": "custom",
                            "tokenizer": "standard"
                        }
                    }
                },
                "number_of_replicas": "1",
                "uuid": "KVI55mDhS4mtumpOqp4mjw",
                "version": {
                    "created": "6060099"
                }
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [July 19, 2019, 8:02pm UTC](https://discuss.elastic.co/t/minimum-should-match-not-working-as-expected/190775/2 "2019-07-19T20:02:05Z")

</div>

> [@Erhan\_Karabulut](#):
>
> ```auto
> "operator":"and",
> 
> ```

Thank means that all terms present in the query have to match. You need to replace it with `or`. Please, see [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/query-dsl-match-query.html#query-dsl-match-query-boolean) for more information on the topic.

---

<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:** [August 16, 2019, 8:02pm UTC](https://discuss.elastic.co/t/minimum-should-match-not-working-as-expected/190775/3 "2019-08-16T20:02:06Z")

</div>

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