|
|
@ -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; |
|
|
|