Skip to content

Commit

Permalink
Merge pull request #321 from pelias/geo_point
Browse files Browse the repository at this point in the history
remove geo_point properties deprecated in 2.3 or 2.4
  • Loading branch information
missinglink authored Sep 27, 2018
2 parents 9305bfa + f7445aa commit dee365f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 104 deletions.
10 changes: 1 addition & 9 deletions mappings/partial/centroid.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
// @ref: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html
var schema = {
'type': 'geo_point',

/* `lat_lon` enabled since both the geo distance and bounding box filters can either be executed using in memory checks, or using the indexed lat lon values */
'lat_lon': true,

/* store geohashes (with prefixes) in order to facilitate the geohash_cell filter */
'geohash': true,
'geohash_prefix': true,
'geohash_precision': 18
'type': 'geo_point'
};

module.exports = schema;
90 changes: 15 additions & 75 deletions test/fixtures/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -1690,11 +1690,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -2017,11 +2013,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -2344,11 +2336,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -2671,11 +2659,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -2998,11 +2982,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -3325,11 +3305,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -3652,11 +3628,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -3979,11 +3951,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -4306,11 +4274,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -4633,11 +4597,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -4960,11 +4920,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -5287,11 +5243,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -5614,11 +5566,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -5941,11 +5889,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down Expand Up @@ -6268,11 +6212,7 @@
}
},
"center_point": {
"type": "geo_point",
"lat_lon": true,
"geohash": true,
"geohash_prefix": true,
"geohash_precision": 18
"type": "geo_point"
},
"shape": {
"type": "geo_shape",
Expand Down
20 changes: 0 additions & 20 deletions test/partial-centroid.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@ module.exports.tests.type = function(test, common) {
});
};

// this should always be enabled for geo_distance filter
// queries to execute correctly
module.exports.tests.latlon = function(test, common) {
test('latlon enabled', function(t) {
t.equal(schema.lat_lon, true, 'correct value');
t.end();
});
};

// this should always be enabled for geohash_cell filter
// queries to execute correctly
module.exports.tests.geohash = function(test, common) {
test('geohash enabled', function(t) {
t.equal(schema.geohash, true, 'correct value');
t.equal(schema.geohash_prefix, true, 'correct value');
t.equal(schema.geohash_precision, 18, 'correct value');
t.end();
});
};

module.exports.all = function (tape, common) {

function test(name, testFunction) {
Expand Down

0 comments on commit dee365f

Please sign in to comment.