# Match phrase and multi\_match together

**URL:** <https://discuss.elastic.co/t/match-phrase-and-multi-match-together/349574>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [December 18, 2023, 3:51pm UTC](https://discuss.elastic.co/t/match-phrase-and-multi-match-together/349574 "2023-12-18T15:51:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![varindert](https://avatars.discourse-cdn.com/v4/letter/v/919ad9/32.png) [@varindert](https://discuss.elastic.co/u/varindert)\
**Post date:** [December 18, 2023, 3:51pm UTC](https://discuss.elastic.co/t/match-phrase-and-multi-match-together/349574/1 "2023-12-18T15:51:29Z")

</div>

Hello, just wondering how I can implement match phrase (on multiple fields) and multi\_match together. I have a basic query going, but I am not able to figure out phrase match on multiple fields. I want results return in following order:

1. Exact phrase match (word sequence matter with some slop)
2. All words in query matched with AND (words sequence does not matter)
3. Any word in query matched. (OR)  
This is what I have so far:

```auto
{
  "query": {
    "bool": {
      "should": [
        {
          "multi_match": {
            "query": "Debit card charges",
            "fields": [
              "title^4",
              "description^3",
              "keywords^3",
              "procedurenumber^4"
            ],
            "type": "most_fields",
            "operator": "or",
            "minimum_should_match": 1,
            "tie_breaker": 0,
            "analyzer": "standard",
            "boost": 1,
            "fuzziness": "AUTO",
            "fuzzy_transpositions": true,
            "auto_generate_synonyms_phrase_query": true,
            "zero_terms_query": "none"
          }
        },
        {
          "match_phrase": {
            "title": "Debit card charges"
            
          }
        }

```

---

<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:** [January 15, 2024, 3:52pm UTC](https://discuss.elastic.co/t/match-phrase-and-multi-match-together/349574/2 "2024-01-15T15:52:16Z")

</div>

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