mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
2.7 KiB
102 lines
2.7 KiB
var peliasQuery = require('pelias-query'); |
|
var _ = require('lodash'); |
|
|
|
module.exports = _.merge({}, peliasQuery.defaults, { |
|
|
|
'size': 20, |
|
'track_scores': true, |
|
|
|
'centroid:field': 'center_point', |
|
|
|
'sort:distance:order': 'asc', |
|
'sort:distance:distance_type': 'plane', |
|
|
|
'boundary:circle:radius': '50km', |
|
'boundary:circle:distance_type': 'plane', |
|
'boundary:circle:optimize_bbox': 'indexed', |
|
|
|
'boundary:rect:type': 'indexed', |
|
|
|
'ngram:analyzer': 'peliasQueryPartialToken', |
|
'ngram:field': 'name.default', |
|
'ngram:boost': 100, |
|
'ngram:cutoff_frequency': 0.01, |
|
|
|
'phrase:analyzer': 'peliasQueryFullToken', |
|
'phrase:field': 'name.default', |
|
'phrase:boost': 1, |
|
'phrase:slop': 3, |
|
'phrase:cutoff_frequency': 0.01, |
|
|
|
'focus:function': 'linear', |
|
'focus:offset': '0km', |
|
'focus:scale': '250km', |
|
'focus:decay': 0.5, |
|
'focus:weight': 15, |
|
|
|
'function_score:score_mode': 'avg', |
|
'function_score:boost_mode': 'replace', |
|
|
|
'address:housenumber:analyzer': 'peliasHousenumber', |
|
'address:housenumber:field': 'address_parts.number', |
|
'address:housenumber:boost': 2, |
|
|
|
'address:street:analyzer': 'peliasStreet', |
|
'address:street:field': 'address_parts.street', |
|
'address:street:boost': 5, |
|
|
|
'address:postcode:analyzer': 'peliasZip', |
|
'address:postcode:field': 'address_parts.zip', |
|
'address:postcode:boost': 2000, |
|
|
|
'address:cutoff_frequency': 0.01, |
|
|
|
'admin:country_a:analyzer': 'standard', |
|
'admin:country_a:field': 'parent.country_a', |
|
'admin:country_a:boost': 1000, |
|
|
|
'admin:country:analyzer': 'peliasAdmin', |
|
'admin:country:field': 'parent.country', |
|
'admin:country:boost': 800, |
|
|
|
'admin:region:analyzer': 'peliasAdmin', |
|
'admin:region:field': 'parent.region', |
|
'admin:region:boost': 600, |
|
|
|
'admin:region_a:analyzer': 'peliasAdmin', |
|
'admin:region_a:field': 'parent.region_a', |
|
'admin:region_a:boost': 600, |
|
|
|
'admin:county:analyzer': 'peliasAdmin', |
|
'admin:county:field': 'parent.county', |
|
'admin:county:boost': 400, |
|
|
|
'admin:localadmin:analyzer': 'peliasAdmin', |
|
'admin:localadmin:field': 'parent.localadmin', |
|
'admin:localadmin:boost': 200, |
|
|
|
'admin:locality:analyzer': 'peliasAdmin', |
|
'admin:locality:field': 'parent.locality', |
|
'admin:locality:boost': 200, |
|
|
|
'admin:neighbourhood:analyzer': 'peliasAdmin', |
|
'admin:neighbourhood:field': 'parent.neighbourhood', |
|
'admin:neighbourhood:boost': 200, |
|
|
|
'admin:borough:analyzer': 'peliasAdmin', |
|
'admin:borough:field': 'parent.borough', |
|
'admin:borough:boost': 600, |
|
|
|
'admin:cutoff_frequency': 0.01, |
|
|
|
'popularity:field': 'popularity', |
|
'popularity:modifier': 'log1p', |
|
'popularity:max_boost': 20, |
|
'popularity:weight': 1, |
|
|
|
'population:field': 'population', |
|
'population:modifier': 'log1p', |
|
'population:max_boost': 20, |
|
'population:weight': 3 |
|
|
|
});
|
|
|