# Multi match equal both fields

**URL:** <https://discuss.elastic.co/t/multi-match-equal-both-fields/261463>\
**Category:** Elasticsearch\
**Created:** [January 18, 2021, 6:56pm UTC](https://discuss.elastic.co/t/multi-match-equal-both-fields/261463 "2021-01-18T18:56:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seefor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seefor/32/82466_2.png) [@seefor](https://discuss.elastic.co/u/seefor)\
**Post date:** [January 18, 2021, 6:56pm UTC](https://discuss.elastic.co/t/multi-match-equal-both-fields/261463/1 "2021-01-18T18:56:31Z")

</div>

New to elastic search  
I have the following search, which works great but I would like to only return when both "result.confidence", "result.severity" = HIGH instead of when either equal HIGH

```auto
    {
  "size": 10000, 
    "query": {
      "bool": {
        "filter": [
          {
        "multi_match": {
        "query": "HIGH",
        "fields": ["result.confidence", "result.severity"]
      }
      },
      {
                    "range" : {
            "@timestamp": {
                "gte" : "now-1h",
                "lt" : "now"
            }
        }
    
          }
        ]
      }
    }
}

```

---

<div class="post-metadata">

**Author:** ![seefor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seefor/32/82466_2.png) [@seefor](https://discuss.elastic.co/u/seefor)\
**Post date:** [January 18, 2021, 7:32pm UTC](https://discuss.elastic.co/t/multi-match-equal-both-fields/261463/2 "2021-01-18T19:32:20Z")

</div>

I found the solution, I will post it here in case someone else needs it

```auto
{
  "size": 10000, 
    "query": {
        "bool": {
            "must": [
                {
                    "match": {
                       "result.confidence": "HIGH"
                    }
                },
                {
                    "match": {
                       "result.severity": "HIGH"
                    }
                },
                        {
          "range": {
            "@timestamp": {
              "gte": "now-1h",
              "lt": "now"
            }
          }
        }
            ]
        }
    }
}

```

---

<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:** [February 15, 2021, 7:32pm UTC](https://discuss.elastic.co/t/multi-match-equal-both-fields/261463/3 "2021-02-15T19:32:43Z")

</div>

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