# Strange behaviour with filters not working

**URL:** <https://discuss.elastic.co/t/strange-behaviour-with-filters-not-working/117369>\
**Category:** Kibana\
**Created:** [January 28, 2018, 1:14pm UTC](https://discuss.elastic.co/t/strange-behaviour-with-filters-not-working/117369 "2018-01-28T13:14:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_Stoney](https://avatars.discourse-cdn.com/v4/letter/k/76d3ee/32.png) [@Karl\_Stoney](https://discuss.elastic.co/u/Karl_Stoney)\
**Post date:** [January 28, 2018, 1:14pm UTC](https://discuss.elastic.co/t/strange-behaviour-with-filters-not-working/117369/1 "2018-01-28T13:14:48Z")

</div>

Hi,  
I'm experiencing strange behaviour and hoping someone could help me out.

We've recently migrated to es 6.1.2 and imported all of our dashboards and visualisations from kibana 5.

We've got some very strange behaviour however where visualisations aren't working unless we change the filter type to something else, then back to what it was?!

For example, clicking search on the visualistion shows this in console:

 ![47](https://us1.discourse-cdn.com/elastic/original/3X/5/e/5e5fdcff8ff8bfaec7de166f4a4423548c515cf1.png)

You can see the search/json seemed to return ok:

 ![58](https://us1.discourse-cdn.com/elastic/original/3X/9/4/946c43e9b63d8d9bb199ba4070ca0d12c9c9a13b.png)

If I toggle the filter from "Term" to something else, then back to "Term", it's fine:  
 ![33](https://us1.discourse-cdn.com/elastic/original/3X/7/d/7da6b39644b26b68f4e7cd61e3fb2b7f2ac2f6b0.png)

Can't really see any difference in the response!:

 ![48](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f67da6969d6d169da40b0bc6261325e1bef7619.png)

So I started to look at the differences in the stored JSON between an "unfixed" and "fixed" visualisation.  
Problem state:

```auto
{ title: 'retail-check.vehicles added to stock',
  type: 'histogram',
  params:
   { shareYAxis: true,
     addTooltip: true,
     addLegend: true,
     scale: 'linear',
     mode: 'stacked',
     times: [],
     addTimeMarker: false,
     defaultYExtents: false,
     setYExtents: false,
     yAxis: {} },
  aggs:
   [{ id: '1', type: 'count', schema: 'metric', params: [Object] },
     { id: '2',
       type: 'date_histogram',
       schema: 'segment',
       params: [Object] },
     { id: '3', type: 'filters', schema: 'group', params: [Object] } ],
  listeners: {} }

```

After a save (working state):

```auto
{ title: 'retail-check.vehicles added to stock',
  type: 'histogram',
  params:
   { shareYAxis: true,
     addTooltip: true,
     addLegend: true,
     scale: 'linear',
     mode: 'stacked',
     times: [],
     addTimeMarker: false,
     defaultYExtents: false,
     setYExtents: false,
     yAxis: {},
     type: 'histogram',
     grid: { categoryLines: false, style: [Object] },
     categoryAxes: [[Object] ],
     valueAxes: [[Object] ],
     seriesParams: [[Object] ],
     legendPosition: 'right' },
  aggs:
   [ { id: '1',
       enabled: true,
       type: 'count',
       schema: 'metric',
       params: [Object] },
     { id: '2',
       enabled: true,
       type: 'date_histogram',
       schema: 'segment',
       params: [Object] },
     { id: '3',
       enabled: true,
       type: 'filters',
       schema: 'group',
       params: [Object] } ] }

```

So there are some differences... We've got 1000's of visualisations so would rather not have to manually toggle the filters on them all!

Anyone got any ideas how to ease this pain?

---

<div class="post-metadata">

**Author:** ![Karl\_Stoney](https://avatars.discourse-cdn.com/v4/letter/k/76d3ee/32.png) [@Karl\_Stoney](https://discuss.elastic.co/u/Karl_Stoney)\
**Post date:** [January 28, 2018, 2:23pm UTC](https://discuss.elastic.co/t/strange-behaviour-with-filters-not-working/117369/3 "2018-01-28T14:23:13Z")

</div>

Digging into this a little more I see a difference in the way the filters are being stored:

broken:

```auto
> a.aggs[2].params.filters[0]
{ input: { query: { query_string: [Object] } }, label: '' }

```

working:

```auto
> a.aggs[2].params.filters[0]
{ input:
   { query: 'dotted-name-by-all:at-portal.live.by-all.counter.status.2??.api.appraisal-vehicle.add-to-stock' },
  label: '' }

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 29, 2018, 8:37am UTC](https://discuss.elastic.co/t/strange-behaviour-with-filters-not-working/117369/4 "2018-01-29T08:37:11Z")

</div>

I moved this over to the Kibana forum, as that question seems to be more appropriate over here.

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [January 29, 2018, 10:48am UTC](https://discuss.elastic.co/t/strange-behaviour-with-filters-not-working/117369/5 "2018-01-29T10:48:34Z")

</div>

Hi Karl,

just to confirm I get you correctly: This only effects visualizations, that uses the Filter Bucket aggregation? Not filters attached to any visualization?

Cheers,  
Tim

---

<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 26, 2018, 10:48am UTC](https://discuss.elastic.co/t/strange-behaviour-with-filters-not-working/117369/6 "2018-02-26T10:48:42Z")

</div>

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