Skip to content

Commit

Permalink
feat: Merge pull request #167 from pelias/add-dependency-support
Browse files Browse the repository at this point in the history
added `dependency` in the various places
  • Loading branch information
trescube authored Aug 19, 2016
2 parents 2b1316e + 48aa8fa commit d102a8a
Show file tree
Hide file tree
Showing 4 changed files with 420 additions and 1 deletion.
5 changes: 5 additions & 0 deletions mappings/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ var schema = {
country_a: admin,
country_id: literal,

// https://github.com/whosonfirst/whosonfirst-placetypes#dependency
dependency: admin,
dependency_a: admin,
dependency_id: literal,

// https://github.com/whosonfirst/whosonfirst-placetypes#macroregion
macroregion: admin,
macroregion_a: admin,
Expand Down
1 change: 1 addition & 0 deletions schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var schema = {
querying against non-existant _types will result in errors.
**/
country: doc,
dependency: doc,
macroregion: doc,
region: doc,
macrocounty: doc,
Expand Down
2 changes: 1 addition & 1 deletion test/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports.tests.address_analysis = function(test, common) {

// should contain the correct parent field definitions
module.exports.tests.parent_fields = function(test, common) {
var fields = ['country', 'country_a', 'country_id', 'macroregion', 'macroregion_a', 'macroregion_id', 'region', 'region_a', 'region_id', 'macrocounty', 'macrocounty_a', 'macrocounty_id', 'county', 'county_a', 'county_id', 'locality', 'locality_a', 'locality_id', 'borough', 'borough_a', 'borough_id', 'localadmin', 'localadmin_a', 'localadmin_id', 'neighbourhood', 'neighbourhood_a', 'neighbourhood_id'];
var fields = ['country', 'country_a', 'country_id', 'dependency', 'dependency_a', 'dependency_id', 'macroregion', 'macroregion_a', 'macroregion_id', 'region', 'region_a', 'region_id', 'macrocounty', 'macrocounty_a', 'macrocounty_id', 'county', 'county_a', 'county_id', 'locality', 'locality_a', 'locality_id', 'borough', 'borough_a', 'borough_id', 'localadmin', 'localadmin_a', 'localadmin_id', 'neighbourhood', 'neighbourhood_a', 'neighbourhood_id'];
test('parent fields specified', function(t) {
t.deepEqual(Object.keys(schema.properties.parent.properties), fields);
t.end();
Expand Down
Loading

0 comments on commit d102a8a

Please sign in to comment.