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


(Tom Druyts) #1

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"
              }
            }
        }
        ]
    }
  }
}`

(system) #2