# In filter context, is the filter array AND or OR?

**URL:** https://discuss.elastic.co/t/in-filter-context-is-the-filter-array-and-or-or/368802
**Category:** Elasticsearch
**Created:** [October 14, 2024, 8:19pm UTC](https://discuss.elastic.co/t/in-filter-context-is-the-filter-array-and-or-or/368802 "2024-10-14T20:19:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![matt.snyder](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@matt.snyder](https://discuss.elastic.co/u/matt.snyder)
#### Post date: [October 14, 2024, 8:19pm UTC](https://discuss.elastic.co/t/in-filter-context-is-the-filter-array-and-or-or/368802/1 "2024-10-14T20:19:32Z")

</div>

In query DSL, I have a function score with a date decay, and a filter on that date decay, and I'm surprised to find that the filters in the filter array appear to be OR'd, not ANDed. In other words, the date decay is apply for things that match either filter clause. I cannot find any documentation about how the list of filter clauses in the array are treated.

```auto
 "function_score": {
          "functions": [
            {
              "filter": [
                {"term": {"mcontenttype": "Grant"}},
                {"term": {"mcontenttype": "Event"}}
              ],
              "linear": {
                "mdateprimary": {"scale": "365d","offset": "0d","decay": 0.7}},
              "weight": 100
            },

```

---

<div class="post-metadata">

### Author: ![nfeekery](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nfeekery/32/117349_2.png) [@nfeekery](https://discuss.elastic.co/u/nfeekery)
#### Post date: [October 15, 2024, 3:06pm UTC](https://discuss.elastic.co/t/in-filter-context-is-the-filter-array-and-or-or/368802/2 "2024-10-15T15:06:12Z")

</div>

From #Elastic Search to #Elasticsearch

---

<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: [November 12, 2024, 3:06pm UTC](https://discuss.elastic.co/t/in-filter-context-is-the-filter-array-and-or-or/368802/3 "2024-11-12T15:06:13Z")

</div>

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