Allow more than match queries in custom filters (#8905)

Backports PR #8614

**Commit 1:**
Allow more than match queries in custom filters

If a user attempted to create a custom filter without a match query
Kibana would error out because it assumed all queries were match
queries. This adds a stricter conditional so that we only attempt to
read the match config if a match property actually exists.

* Original sha: e9241cdba5
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-10T20:37:50Z
This commit is contained in:
jasper 2016-10-31 17:29:42 -04:00 committed by Matt Bargar
parent e4de00da19
commit 181221822e

View file

@ -23,7 +23,7 @@ export default function (Private) {
return filter.exists.field === value;
}
if (filter.query) {
if (_.get(filter, 'query.match')) {
return filter.query.match[fieldName] && filter.query.match[fieldName].query === value;
}