Browse Source

Merge pull request #522 from pelias/admin_borough

Search borough when searching admin fields
pull/524/head
Julian Simioni 9 years ago
parent
commit
ae5549dde8
  1. 4
      query/search_defaults.js
  2. 11
      query/text_parser.js

4
query/search_defaults.js

@ -78,6 +78,10 @@ module.exports = _.merge({}, peliasQuery.defaults, {
'admin:locality:field': 'parent.locality',
'admin:locality:boost': 1,
'admin:borough:analyzer': 'peliasAdmin',
'admin:borough:field': 'parent.borough',
'admin:borough:boost': 1,
'admin:neighbourhood:analyzer': 'peliasAdmin',
'admin:neighbourhood:field': 'parent.neighbourhood',
'admin:neighbourhood:boost': 1,

11
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

Loading…
Cancel
Save