# Difference between add a filter and a condition in the search box

**URL:** https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250
**Category:** Kibana
**Created:** [July 23, 2018, 8:43pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250 "2018-07-23T20:43:28Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![subhasree25](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@subhasree25](https://discuss.elastic.co/u/subhasree25)
#### Post date: [July 23, 2018, 8:43pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/1 "2018-07-23T20:43:28Z")

</div>

Hello everyone,

I am new to this forum so I want to apologize in advance if this topic is already discussed.  
I was creating a visualization in Kibana and I got two different results when I added a filter vs. I put the same condition in the search box above. Is there a reason for this? Does the two functionality work in two different ways?

P.S I have only learnt how to use to use the Kibana interface recently and don't have any idea how the backed elastic search code works, so if you can provide some solution keeping this in mind that would be really helpful.

Thank you.

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [July 24, 2018, 9:52pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/2 "2018-07-24T21:52:54Z")

</div>

I'm just wanting to clarify, do you mean when you use the "Add a filter" dialog vs. when you type in the search bar, or when you're using the "filters" bucket aggregation?

What are you typing in the search box and what are you using for the filter?

Thanks!

---

<div class="post-metadata">

### Author: ![subhasree25](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@subhasree25](https://discuss.elastic.co/u/subhasree25)
#### Post date: [July 25, 2018, 1:49pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/3 "2018-07-25T13:49:54Z")

</div>

Hey Lucas, I meant "Add a filter" dialog vs. typing that same condition in the search bar.  
So for example if I am using country is "USA" in the filter dialog vs. country:"USA" in the search bar, I am getting completely different results. So I was wondering if the two functionalities work differently.

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [July 25, 2018, 8:50pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/4 "2018-07-25T20:50:21Z")

</div>

If you type `country: "USA"` in the search bar, this will do a [`query_string`](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/query-dsl-query-string-query.html) query whereas the filter bar will do a [`match_phrase`](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/query-dsl-match-query-phrase.html).

---

<div class="post-metadata">

### Author: ![subhasree25](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@subhasree25](https://discuss.elastic.co/u/subhasree25)
#### Post date: [July 26, 2018, 5:51pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/5 "2018-07-26T17:51:25Z")

</div>

I read through the links but I am a bit confused. Will you be able to explain with this particular example what's the difference?

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [July 26, 2018, 11:49pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/6 "2018-07-26T23:49:48Z")

</div>

Yeah, can you provide your mapping for that field?

---

<div class="post-metadata">

### Author: ![subhasree25](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@subhasree25](https://discuss.elastic.co/u/subhasree25)
#### Post date: [July 27, 2018, 1:55pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/7 "2018-07-27T13:55:08Z")

</div>

Sorry, but what do you mean by mapping?

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [July 27, 2018, 4:15pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/8 "2018-07-27T16:15:25Z")

</div>

If you go into the Kibana dev tools, do the following:

```auto
GET /your_index_name/your_type_name/_mapping

```

And paste the results in a comment here.

---

<div class="post-metadata">

### Author: ![subhasree25](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@subhasree25](https://discuss.elastic.co/u/subhasree25)
#### Post date: [July 27, 2018, 4:58pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/9 "2018-07-27T16:58:00Z")

</div>

"path\_url": {  
"type": "keyword"  
},

Is this what you are looking for?

---

<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: [August 24, 2018, 4:58pm UTC](https://discuss.elastic.co/t/difference-between-add-a-filter-and-a-condition-in-the-search-box/141250/10 "2018-08-24T16:58:02Z")

</div>

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