Skip to content

Commit

Permalink
feat(mapping): Remove unused alpha3 field
Browse files Browse the repository at this point in the history
We stopped using the `alpha3` field over [two years ago](pelias/query#6),
but it was still lingering in our schema including some tests.

This was discovered while updating and testing #282.
  • Loading branch information
orangejulius committed Nov 3, 2018
1 parent db8b237 commit 9d9def4
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 85 deletions.
14 changes: 0 additions & 14 deletions integration/admin_matching.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports.tests.functional = function(test, common){
suite.client.index({
index: suite.props.index, type: 'test',
id: '1', body: { admin: {
alpha3: 'TST',
country: 'Test Country',
country_a: 'TestCountry',
country_id: '100',
Expand All @@ -41,19 +40,6 @@ module.exports.tests.functional = function(test, common){
}, done );
});

// search by alpha3
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'test',
body: { query: { match: { 'admin.alpha3': 'TST' } } }
}, function( err, res ){
t.equal( err, undefined );
t.equal( res.hits.total, 1, 'document found' );
done();
});
});

// search by country
suite.assert( function( done ){
suite.client.search({
Expand Down
1 change: 0 additions & 1 deletion mappings/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var schema = {
// data partitioning
source: literal_with_doc_values,
layer: literal_with_doc_values,
alpha3: admin,

// place name (ngram analysis)
name: hash,
Expand Down
11 changes: 1 addition & 10 deletions test/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports.tests.properties = function(test, common) {

// should contain the correct field definitions
module.exports.tests.fields = function(test, common) {
var fields = ['source', 'layer', 'alpha3', 'name', 'phrase', 'address_parts',
var fields = ['source', 'layer', 'name', 'phrase', 'address_parts',
'parent', 'center_point', 'shape', 'bounding_box', 'source_id', 'category',
'population', 'popularity'];
test('fields specified', function(t) {
Expand Down Expand Up @@ -135,15 +135,6 @@ module.exports.tests.parent_analysis = function(test, common) {
});
};

module.exports.tests.alpha3_analysis = function(test, common) {
var prop = schema.properties.alpha3;
test('alpha3', function(t) {
t.equal(prop.type, 'string');
t.equal(prop.analyzer, 'peliasAdmin');
t.end();
});
};

module.exports.tests.dynamic_templates = function(test, common) {
test('dynamic_templates: nameGram', function(t) {
t.equal(typeof schema.dynamic_templates[0].nameGram, 'object', 'nameGram template specified');
Expand Down
60 changes: 0 additions & 60 deletions test/fixtures/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -1447,10 +1447,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -1740,10 +1736,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -2033,10 +2025,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -2326,10 +2314,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -2619,10 +2603,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -2912,10 +2892,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -3205,10 +3181,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -3498,10 +3470,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -3791,10 +3759,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -4084,10 +4048,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -4377,10 +4337,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -4670,10 +4626,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -4963,10 +4915,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -5256,10 +5204,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down Expand Up @@ -5549,10 +5493,6 @@
"type": "string",
"index": "not_analyzed"
},
"alpha3": {
"type": "string",
"analyzer": "peliasAdmin"
},
"name": {
"type": "object",
"dynamic": true
Expand Down

0 comments on commit 9d9def4

Please sign in to comment.