From f8af354e71f06cc5deb65e5285848d60f442db58 Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Thu, 21 Apr 2016 14:58:17 -0400 Subject: [PATCH] Base admin fields on placetypes --- query/text_parser.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/query/text_parser.js b/query/text_parser.js index 38fca48e..d19465eb 100644 --- a/query/text_parser.js +++ b/query/text_parser.js @@ -1,20 +1,15 @@ 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 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. */ -var adminFields = [ - 'country', - 'region', +var adminFields = placeTypes.concat([ 'region_a', - 'county', - 'localadmin', - 'locality', - 'neighbourhood' -]; +]); /** @todo: refactor me @@ -101,4 +96,4 @@ function addParsedVariablesToQueryVariables( parsed_text, vs ){ } } -module.exports = addParsedVariablesToQueryVariables; \ No newline at end of file +module.exports = addParsedVariablesToQueryVariables;