# Term query Kibana

**URL:** https://discuss.elastic.co/t/term-query-kibana/214592
**Category:** Kibana
**Created:** [January 10, 2020, 11:27am UTC](https://discuss.elastic.co/t/term-query-kibana/214592 "2020-01-10T11:27:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rvanegmond](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@rvanegmond](https://discuss.elastic.co/u/rvanegmond)
#### Post date: [January 10, 2020, 11:27am UTC](https://discuss.elastic.co/t/term-query-kibana/214592/1 "2020-01-10T11:27:42Z")

</div>

I'm looking into a way to perform a term query straight from the search bar in Kibana. Found some stuff on this but last post is about a year old. I know I can then do this by editing the filter using the query DSL. When I use the defaults it is using a phrase query or a match but not a term query.

---

<div class="post-metadata">

### Author: ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)
#### Post date: [January 10, 2020, 11:15pm UTC](https://discuss.elastic.co/t/term-query-kibana/214592/2 "2020-01-10T23:15:58Z")

</div>

If you just input plain text you will get a match or phrase query.

However, you can leverage the KQL syntax to filter on specific terms. I'd recommend checking out the docs here on how to specify these queries: [https://www.elastic.co/guide/en/kibana/current/kuery-query.html](https://www.elastic.co/guide/en/kibana/current/kuery-query.html)

---

<div class="post-metadata">

### Author: ![rvanegmond](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@rvanegmond](https://discuss.elastic.co/u/rvanegmond)
#### Post date: [January 15, 2020, 8:26am UTC](https://discuss.elastic.co/t/term-query-kibana/214592/3 "2020-01-15T08:26:06Z")

</div>

Please explain a little bit more. I have been reading these docs but what ever combination I try, when I inspect the request I see either a match or a phrase query.

So using the KQL I tried:

field:value - \> match  
field:"value" -\> phrase

Using the filters saying "field is value" also results in a match phrase. The same accounts for clicking the value from the results.

I need the term query for filtering on text analysed by the pathhierarchy tokenizer.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-pathhierarchy-tokenizer-examples.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-pathhierarchy-tokenizer-examples.html)

---

<div class="post-metadata">

### Author: ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)
#### Post date: [January 16, 2020, 9:14pm UTC](https://discuss.elastic.co/t/term-query-kibana/214592/4 "2020-01-16T21:14:54Z")

</div>

I'm not reproducing that effect. Mine is a bool query (not terms, like I mentioned before). Make sure you have KQL turned on:

 ![Screen Shot 2020-01-16 at 2.13.39 PM](https://us1.discourse-cdn.com/elastic/original/3X/3/c/3cb82d6e2b6ea7272674c0e9dc8f4254a5259efe.png)

Here was my query:

```auto
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "bool": {
            "should": [
              {
                "range": {
                  "@timestamp": {
                    "gte": "now",
                    "lte": "now",
                    "time_zone": "xxxxx"
                  }
                }
              }
            ],
            "minimum_should_match": 1
          }
        },
        {
          "range": {
            "@timestamp": {
              "format": "strict_date_optional_time",
              "gte": "2019-12-17T21:13:03.265Z",
              "lte": "2020-01-16T21:13:03.265Z"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  },

```

---

<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 13, 2020, 9:15pm UTC](https://discuss.elastic.co/t/term-query-kibana/214592/5 "2020-02-13T21:15:02Z")

</div>

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