From 2a62caeb15048fef56ca5872b0aa6a6f74758731 Mon Sep 17 00:00:00 2001 From: nreese Date: Tue, 13 Dec 2016 17:04:37 -0700 Subject: [PATCH] update geo_distance filter construction for ES5 --- public/visController.js | 2 +- public/vislib/geoFilter.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/public/visController.js b/public/visController.js index 02fb93e..cfa74c2 100644 --- a/public/visController.js +++ b/public/visController.js @@ -139,7 +139,7 @@ define(function (require) { //add overlay layer to provide visibility of filtered area let fieldName = getGeoField(); if (fieldName) { - map.addFilters(geoFilter.toGeoJson(fieldName)); + map.addFilters(geoFilter.getGeoFilters(fieldName)); } drawWmsOverlays(); diff --git a/public/vislib/geoFilter.js b/public/vislib/geoFilter.js index ca40b6e..4da8d45 100644 --- a/public/vislib/geoFilter.js +++ b/public/vislib/geoFilter.js @@ -13,7 +13,7 @@ define(function (require) { function addGeoFilter(newFilter, field, indexPatternName) { let existingFilter = null; _.flatten([queryFilter.getAppFilters(), queryFilter.getGlobalFilters()]).forEach(function (it) { - if (utils.isGeoFilter(it, field)) { + if (isGeoFilter(it, field)) { existingFilter = it; } }); @@ -48,7 +48,11 @@ define(function (require) { let numFilters = 1; if (_.isArray(newFilter)) { numFilters = newFilter.length; - newFilter = { or: newFilter }; + newFilter = { + bool: { + should: newFilter + } + }; } newFilter.meta = { alias: filterAlias(field, numFilters),