Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"boundary:circle:radius": "50km",
"boundary:circle:distance_type": "plane",

"boundary:rect:type": "indexed",

"ngram:analyzer": "peliasOneEdgeGram",
"ngram:field": "name.default",
"ngram:boost": 1,
Expand Down
2 changes: 0 additions & 2 deletions test/view/boundary_rect.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function getBaseVariableStore(toExclude) {
vs.var('boundary:rect:right', 'right value');
vs.var('boundary:rect:bottom', 'bottom value');
vs.var('boundary:rect:left', 'left value');
vs.var('boundary:rect:type', 'type value');
vs.var('centroid:field', 'field value');

if (toExclude) {
Expand Down Expand Up @@ -52,7 +51,6 @@ module.exports.tests.no_exceptions_conditions = function(test, common) {

var expected = {
geo_bounding_box: {
type: { $: 'type value' },
'field value': {
top: { $: 'top value' },
right: { $: 'right value' },
Expand Down
18 changes: 7 additions & 11 deletions view/boundary_rect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@ module.exports = function( vs ){
!vs.isset('boundary:rect:right') ||
!vs.isset('boundary:rect:bottom') ||
!vs.isset('boundary:rect:left') ||
!vs.isset('boundary:rect:type') ||
!vs.isset('centroid:field') ){
return null;
}

// base view
// base view with bbox
var view = {
geo_bounding_box: {
type: vs.var('boundary:rect:type')
[ vs.var('centroid:field') ]: {
top: vs.var('boundary:rect:top'),
right: vs.var('boundary:rect:right'),
bottom: vs.var('boundary:rect:bottom'),
left: vs.var('boundary:rect:left')
}
}
};

// bbox
view.geo_bounding_box[ vs.var('centroid:field') ] = {
top: vs.var('boundary:rect:top'),
right: vs.var('boundary:rect:right'),
bottom: vs.var('boundary:rect:bottom'),
left: vs.var('boundary:rect:left')
};

return view;
};