Skip to content

Commit

Permalink
update geo_distance filter construction for ES5
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Dec 14, 2016
1 parent cc07969 commit 2a62cae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/visController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 6 additions & 2 deletions public/vislib/geoFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 2a62cae

Please sign in to comment.