title: Decay function across multiple indices where decay field name might not exist
body: <p>I'm trying to use a decay function across multiple indices. The issue I'm having is that some of those indices do not have the field that the decay function uses so I'm getting the following error.</p>
  
  <pre><code>{"type":"parsing_exception","reason":"unknown field [start_date]","line":1,"col":0},{"type":"parsing_exception","reason":"unknown field [match_date]","line":1,"col":0}
  </code></pre>
  
  <p>I can provide any additional information that would be helpful.</p>
  
  <p>The documentation shows that there is a filter option that I attempted to use however it is still tripping up when not finding the field.</p>
  
  <p>I'm using the php flavor of elasticsearch.</p>
  
  <pre><code>'query' =&gt; [
                  "function_score" =&gt; [
                      'query' =&gt; [
                          "bool" =&gt; [
                              "must" =&gt; [
                                  "multi_match" =&gt; [
                                      "query" =&gt; $search,
                                      "fields" =&gt; [
                                          "match_web_name",
                                          "shooter_result_name",
                                          "name",
                                          "post_match_name",
                                          "club_name"
                                      ]
                                  ]
                              ],
                              "should" =&gt; [
                                  [
                                      "term" =&gt; [
                                          "private" =&gt; 0
                                      ],
                                  ]
                              ]
                          ]
                      ],
                      "functions" =&gt; [
                          [
                              "filter" =&gt; [ "exists" =&gt; ["field" =&gt; "start_date"]],
                              "linear" =&gt; [
                                  "start_date" =&gt; [
                                      "origin" =&gt; 'now',
                                      "scale" =&gt; $scale
                                  ]
                              ]
                          ],
  
                          [
                              "filter" =&gt; [ "exists" =&gt; ["field" =&gt; "match_date"]],
                              "linear" =&gt; [
                                  "match_date" =&gt; [
                                      "origin" =&gt; 'now',
                                      "scale" =&gt; $scale
                                  ]
                              ]
                          ]
                      ]
                  ]
              ]
  </code></pre>
  
  <p>Here is the mapping for an index that does not have the <code>start_date</code></p>
  
  <pre><code>  "club": {
  "properties": {
    "zip": {
      "type": "text",
      "fields": {
        "raw": {
          "type": "keyword"
        }
      }
    },
    "website": {
      "type": "text",
      "fields": {
        "raw": {
          "type": "keyword"
        }
      }
    },
    "city": {
      "type": "text",
      "fields": {
        "en": {
          "analyzer": "english",
          "type": "text"
        },
        "raw": {
          "type": "keyword"
        }
      }
    },
    "about": {
      "type": "text",
      "fields": {
        "en": {
          "analyzer": "english",
          "type": "text"
        }
      }
    },
    "tagline": {
      "type": "text",
      "fields": {
        "en": {
          "analyzer": "english",
          "type": "text"
        }
      }
    },
    "location": {
      "ignore_malformed": true,
      "type": "geo_point"
    },
    "id": {
      "type": "integer"
    },
    "state": {
      "type": "text",
      "fields": {
        "en": {
          "analyzer": "english",
          "type": "text"
        },
        "raw": {
          "type": "keyword"
        }
      }
    },
    "club_name": {
      "type": "text",
      "fields": {
        "en": {
          "analyzer": "english",
          "type": "text"
        },
        "raw": {
          "type": "keyword"
        }
      }
    },
    "deleted_at": {
      "format": "yyyy-MM-dd HH:mm:ss",
      "type": "date"
    },
    "slug": {
      "type": "keyword"
    }
  }
  </code></pre>
  
  <p>Here is a mapping where an index does contain the <code>start_date</code></p>
  
  <pre><code>"match": {
  "properties": {
    "end_date": {
      "null_value": "1990-01-01 12:12:12",
      "format": "yyyy-MM-dd HH:mm:ss",
      "type": "date"
    },
    "zip": {
      "type": "text",
      "fields": {
        "raw": {
          "type": "keyword"
        }
      }
    },
    "private": {
      "type": "boolean"
    },
    "reg_close_date": {
      "null_value": "1990-01-01 12:12:12",
      "format": "yyyy-MM-dd HH:mm:ss",
      "type": "date"
    },
    "city": {
      "type": "text",
      "fields": {
        "en": {
          "analyzer": "english",
          "type": "text"
        },
        "raw": {
          "type": "keyword"
        }
      }
    },
    "level": {
      "type": "keyword"
    },
    "description": {
      "type": "text",
      "fields": {
        "en": {
          "analyzer": "english",
          "type": "text"
        }
      }
    },
    "max_shooters": {
      "type": "integer"
    },
    "type": {
      "type": "keyword"
    },
    "deleted_at": {
      "format": "yyyy-MM-dd HH:mm:ss",
      "ignore_malformed": true,
      "type": "date"
    },
    "reg_open_date": {
      "null_value": "1990-01-01 12:12:12",
      "format": "yyyy-MM-dd HH:mm:ss",
      "type": "date"
    },
    "score_type": {
      "type": "keyword"
    },
    "club_id": {
      "type": "integer"
    },
    "match_web_name": {
      "type": "text",
      "fields": {
        "en": {
          "analyzer": "english",
          "type": "text"
        },
        "raw": {
          "type": "keyword"
        }
      }
    },
    "location": {
      "ignore_malformed": true,
      "type": "geo_point"
    },
    "id": {
      "type": "integer"
    },
    "state": {
      "type": "text",
      "fields": {
        "en": {
          "analyzer": "english",
          "type": "text"
        },
        "raw": {
          "type": "keyword"
        }
      }
    },
    "prices": {
      "type": "text",
      "fields": {
        "raw": {
          "type": "keyword"
        }
      }
    },
    "slug": {
      "type": "keyword"
    },
    "start_date": {
      "null_value": "1990-01-01 12:12:12",
      "format": "yyyy-MM-dd HH:mm:ss",
      "type": "date"
    },
    "status": {
      "type": "keyword"
    }
  }
  </code></pre>