# Decay function Unknown field \[pubDateByBrand.brand.unknown\]\]

**URL:** <https://discuss.elastic.co/t/decay-function-unknown-field-pubdatebybrand-brand-unknown/41600>\
**Category:** Elasticsearch\
**Created:** [February 12, 2016, 10:35am UTC](https://discuss.elastic.co/t/decay-function-unknown-field-pubdatebybrand-brand-unknown/41600 "2016-02-12T10:35:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Druyts](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@Tom\_Druyts](https://discuss.elastic.co/u/Tom_Druyts)\
**Post date:** [February 12, 2016, 10:35am UTC](https://discuss.elastic.co/t/decay-function-unknown-field-pubdatebybrand-brand-unknown/41600/1 "2016-02-12T10:35:19Z")

</div>

Hi,

Why do I get a unknown field exception in the query below ? I'm filtering all documents to have the field 'pubDateByBrand.brand.existingbrand' before passing it to the guass decay function. So all documents passed to it should have this field, or at least that's what I'm expecting.

```
`{
  "query" : {
    "function_score": {
      "query": {
        "filtered": {
          "query": {
           "bool" : {
             "must": [
              {
                "term": {
                  "visibility": "PUBLIC"
                }
             }
          ]
        }  
      },
          "filter": {
            "bool": {
              "must": {
                "exists": {
                  "field": "pubDateByBrand.brand.existingbrand"
                }
              }  
            }
          }
        }
      }, 
      "functions": [
        {
            "gauss": {
              "pubDateByBrand.brand.unknown": {
                "scale": "10d"
              }
            }
        }
        ]
    }
  }
}`
```

---

<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:** [July 5, 2017, 11:16pm UTC](https://discuss.elastic.co/t/decay-function-unknown-field-pubdatebybrand-brand-unknown/41600/2 "2017-07-05T23:16:54Z")

</div>


