Skip to content

Commit 76297ee

Browse files
authored
Merge pull request #140 from pelias/joxit/feat/es8
ES8: Remove bounding box query type parameter
2 parents 355b705 + 8979776 commit 76297ee

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

defaults.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
"boundary:circle:radius": "50km",
1212
"boundary:circle:distance_type": "plane",
1313

14-
"boundary:rect:type": "indexed",
15-
1614
"ngram:analyzer": "peliasOneEdgeGram",
1715
"ngram:field": "name.default",
1816
"ngram:boost": 1,

test/view/boundary_rect.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function getBaseVariableStore(toExclude) {
77
vs.var('boundary:rect:right', 'right value');
88
vs.var('boundary:rect:bottom', 'bottom value');
99
vs.var('boundary:rect:left', 'left value');
10-
vs.var('boundary:rect:type', 'type value');
1110
vs.var('centroid:field', 'field value');
1211

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

5352
var expected = {
5453
geo_bounding_box: {
55-
type: { $: 'type value' },
5654
'field value': {
5755
top: { $: 'top value' },
5856
right: { $: 'right value' },

view/boundary_rect.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,21 @@ module.exports = function( vs ){
66
!vs.isset('boundary:rect:right') ||
77
!vs.isset('boundary:rect:bottom') ||
88
!vs.isset('boundary:rect:left') ||
9-
!vs.isset('boundary:rect:type') ||
109
!vs.isset('centroid:field') ){
1110
return null;
1211
}
1312

14-
// base view
13+
// base view with bbox
1514
var view = {
1615
geo_bounding_box: {
17-
type: vs.var('boundary:rect:type')
16+
[ vs.var('centroid:field') ]: {
17+
top: vs.var('boundary:rect:top'),
18+
right: vs.var('boundary:rect:right'),
19+
bottom: vs.var('boundary:rect:bottom'),
20+
left: vs.var('boundary:rect:left')
21+
}
1822
}
1923
};
2024

21-
// bbox
22-
view.geo_bounding_box[ vs.var('centroid:field') ] = {
23-
top: vs.var('boundary:rect:top'),
24-
right: vs.var('boundary:rect:right'),
25-
bottom: vs.var('boundary:rect:bottom'),
26-
left: vs.var('boundary:rect:left')
27-
};
28-
2925
return view;
3026
};

0 commit comments

Comments
 (0)