# Query with multiple keywords

**URL:** <https://discuss.elastic.co/t/query-with-multiple-keywords/289929>\
**Category:** Elasticsearch\
**Created:** [November 23, 2021, 9:37am UTC](https://discuss.elastic.co/t/query-with-multiple-keywords/289929 "2021-11-23T09:37:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leitner](https://avatars.discourse-cdn.com/v4/letter/l/e9bcb4/32.png) [@Leitner](https://discuss.elastic.co/u/Leitner)\
**Post date:** [November 23, 2021, 9:37am UTC](https://discuss.elastic.co/t/query-with-multiple-keywords/289929/1 "2021-11-23T09:37:25Z")

</div>

Hi everyone,

I'm new on Elasticsearch. So sorry for my question 🙂

I want build a query in the console. With a single keyword it works great:

 ![1ab757fb84a722476936ec9a449b9f45](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3bd420dde1a9eabcf9ae1e3174a5e0d9daec41ec.jpeg)

But with multiple keywords the Value of the hits is always 0.  
Iv'e tested different ways. But none of them works.

 ![4a6706dee1d2a9f500143e8dfbf35934](https://us1.discourse-cdn.com/elastic/original/3X/8/4/8406629ec8d8716cbac1bbec6c413190d9f11979.jpeg)  
 ![91b0ece798aee025c1e1351f71b61acf](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f3917468a18018818ada2222677bb020b0fe1b5.jpeg)

Can someone tell me, whats wrong with my code?

```auto
GET _search
{
  "query": {
    "match": {
      "signal.rule.severity": {
        "query": "medium | high | critical"
      }
    }
  }
}

```

I read all manuals that I found. But i cant found the issue.

Thanks for your help  
Patrick

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 23, 2021, 10:00am UTC](https://discuss.elastic.co/t/query-with-multiple-keywords/289929/2 "2021-11-23T10:00:39Z")

</div>

Welcome!

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with `</>` icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

It would be great if you could update your post to solve this.

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can **copy and paste in Kibana dev console** , click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

If those are `keywords` (as per mapping), you can use [Terms query | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html)

---

<div class="post-metadata">

**Author:** ![Leitner](https://avatars.discourse-cdn.com/v4/letter/l/e9bcb4/32.png) [@Leitner](https://discuss.elastic.co/u/Leitner)\
**Post date:** [November 23, 2021, 10:23am UTC](https://discuss.elastic.co/t/query-with-multiple-keywords/289929/3 "2021-11-23T10:23:32Z")

</div>

Thanks a lot. Terms query is the solution!

```auto
GET _search
{
  "query": {
    "terms": {
      "signal.rule.severity": ["medium", "high", "critical"]
    }
  }
}

```

---

<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:** [December 21, 2021, 10:23am UTC](https://discuss.elastic.co/t/query-with-multiple-keywords/289929/4 "2021-12-21T10:23:43Z")

</div>

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