Browse Source

Base admin fields on placetypes

pull/522/head
Julian Simioni 9 years ago
parent
commit
f8af354e71
No known key found for this signature in database
GPG Key ID: 6DAD08919FDBF563
  1. 13
      query/text_parser.js

13
query/text_parser.js

@ -1,20 +1,15 @@
var logger = require('pelias-logger').get('api'); var logger = require('pelias-logger').get('api');
var placeTypes = require('../helper/placeTypes');
/* /*
This list should only contain admin fields we are comfortable matching in the case This list should only contain admin fields we are comfortable matching in the case
when we can't identify parts of an address. This shouldn't contain fields like country_a when we can't identify parts of an address. This shouldn't contain fields like country_a
or postalcode because we should only try to match those when we're sure that's what they are. or postalcode because we should only try to match those when we're sure that's what they are.
*/ */
var adminFields = [ var adminFields = placeTypes.concat([
'country',
'region',
'region_a', 'region_a',
'county', ]);
'localadmin',
'locality',
'neighbourhood'
];
/** /**
@todo: refactor me @todo: refactor me
@ -101,4 +96,4 @@ function addParsedVariablesToQueryVariables( parsed_text, vs ){
} }
} }
module.exports = addParsedVariablesToQueryVariables; module.exports = addParsedVariablesToQueryVariables;

Loading…
Cancel
Save