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.
This commit is contained in:
Matthew Bargar 2016-10-10 16:37:50 -04:00
parent 6000a906e8
commit e9241cdba5

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;
}