Wrong results appearing in elasticsearch must match query

I have the following Analyzer on the search field:

GET _analyze
{
  "tokenizer": "standard",
  "filter":  [ "word_delimiter","lowercase", {"type" : "shingle",
                            "min_shingle_size" : 2,
                            "max_shingle_size" : 4,
                            "output_unigrams" : true}, {"type" : "pattern_replace",
                            "pattern" : " ",
                            "replacement" : ""} ],
  "text":      "One marium malik 270"
}

Elastic search query:

{
  ["index"]=>
  string(19) "_dev"
  ["from"]=>
  int(0)
  ["size"]=>
  int(60)
  ["body"]=>
  array(3) {
    ["query"]=>
    array(1) {
      ["bool"]=>
      array(3) {
        ["should"]=>
        array(2) {
          [0]=>
          array(1) {
            ["bool"]=>
            array(1) {
              ["must"]=>
              array(3) {
                [0]=>
                array(1) {
                  ["match"]=>
                  array(1) {
                    ["searched_text"]=>
                    array(2) {
                      ["query"]=>
                      string(4) "marium"
                      ["fuzziness"]=>
                      string(4) "AUTO"
                    }
                  }
                }
                [1]=>
                array(1) {
                  ["match"]=>
                  array(1) {
                    ["searched_text"]=>
                    array(1) {
                      ["query"]=>
                      string(3) "malik270"
                    }
                  }
                }
                
              }
            }
          }
          [1]=>
          array(1) {
            ["bool"]=>
            array(1) {
              ["should"]=>
              array(1) {
                [0]=>
                array(1) {
                  ["match"]=>
                  array(1) {
                    ["manu_no"]=>
                    array(2) {
                      ["query"]=>
                      string(14) "marium malik270"
                      ["boost"]=>
                      int(10)
                    }
                  }
                }
              }
            }
          }
        }
        ["minimum_should_match"]=>
        int(1)
      }
    }    
    ["sort"]=>
    array(1) {
      ["sp"]=>
      array(2) {
        ["mode"]=>
        string(3) "min"
        ["order"]=>
        string(4) "desc"
      }
    }
  }
}

When I am searching for the above keywords, I am getting several irrelevant results.

Irrelevant results include:

marium malik 97
marium malik Plus TN
marium malik PLUS OG

etc.

But, if I remove 'malik', separate it in another must query:

must: match searched_keyword: 'malik'
must: match searched_keyword: '270'

and leave number alone in that query, then it works perfectly fine.

What could be the issue?

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