# "field cannot be used for filtering" kibana 5.2 error

**URL:** <https://discuss.elastic.co/t/field-cannot-be-used-for-filtering-kibana-5-2-error/77904>\
**Category:** Kibana\
**Created:** [March 8, 2017, 10:14pm UTC](https://discuss.elastic.co/t/field-cannot-be-used-for-filtering-kibana-5-2-error/77904 "2017-03-08T22:14:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@guest](https://discuss.elastic.co/u/guest)\
**Post date:** [March 8, 2017, 10:14pm UTC](https://discuss.elastic.co/t/field-cannot-be-used-for-filtering-kibana-5-2-error/77904/1 "2017-03-08T22:14:48Z")

</div>

I am currently using Elastic Search and Kibana 5.2 stack.

I created a simple kibana pie chart visualisation with count metric and a "string" field in an index.  
I am getting the following error when I try to apply a filter on a string field by clicking on the Kibana pie chart.  
"Filter bar: The "abc.keyword" field cannot be used for filtering"

Has anyone faced this issue before?

Appreciate any help with resolving the issue.

Regards,

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [March 9, 2017, 8:53pm UTC](https://discuss.elastic.co/t/field-cannot-be-used-for-filtering-kibana-5-2-error/77904/2 "2017-03-09T20:53:54Z")

</div>

This sounds like a bug, but I'd like to know more about how you're building the visualization and what the underlying data looks like.

Is the field analyzed? And are you using a non-analyzed field for the pie chart? Or did you enable terms aggs on analyzed fields?

Can you share a screenshot of the expanded Visualize sidebar so I can see how you've built the pie chart?

---

<div class="post-metadata">

**Author:** ![guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@guest](https://discuss.elastic.co/u/guest)\
**Post date:** [March 9, 2017, 10:39pm UTC](https://discuss.elastic.co/t/field-cannot-be-used-for-filtering-kibana-5-2-error/77904/4 "2017-03-09T22:39:25Z")

</div>

Here are the relevant screenshots

Field setup

 ![](https://us1.discourse-cdn.com/elastic/original/3X/e/b/eb4781c0d86c3aaac8a22c9845f722eee0f3167d.jpg)

Visualize Sidebar screenshot

 ![](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d6be693a424476b2c9d0beb6859a88054bcaa811.jpg)

---

<div class="post-metadata">

**Author:** ![j\_a\_k\_e](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@j\_a\_k\_e](https://discuss.elastic.co/u/j_a_k_e)\
**Post date:** [March 12, 2017, 11:37am UTC](https://discuss.elastic.co/t/field-cannot-be-used-for-filtering-kibana-5-2-error/77904/5 "2017-03-12T11:37:40Z")

</div>

Some more details:

- The exact error message is 'Filter bar: The "foo.keyword" field can not be used for filtering."
- It's only broken for one of our indexes, for other indexes in the same instance filtering works as expected.
- It seems to be broken for all the fields in the index including strings, numbers etc.
- However scripted fields always work. So you can work-around by wrapping a field as a scripted field and then filter on that, but this would be really tedious to set up across all the fields.  
Thanks

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [March 15, 2017, 9:01pm UTC](https://discuss.elastic.co/t/field-cannot-be-used-for-filtering-kibana-5-2-error/77904/6 "2017-03-15T21:01:47Z")

</div>

I wonder if the mapping cache is messed up, can you share your [mappings for that field](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html)?

---

<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:** [April 12, 2017, 9:01pm UTC](https://discuss.elastic.co/t/field-cannot-be-used-for-filtering-kibana-5-2-error/77904/7 "2017-04-12T21:01:58Z")

</div>

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