|
|
|
@ -3,9 +3,11 @@ const defaults = require('./autocomplete_defaults');
|
|
|
|
|
const textParser = require('./text_parser_addressit'); |
|
|
|
|
const check = require('check-types'); |
|
|
|
|
const logger = require('pelias-logger').get('api'); |
|
|
|
|
const config = require('pelias-config').generate().api; |
|
|
|
|
|
|
|
|
|
// additional views (these may be merged in to pelias/query at a later date)
|
|
|
|
|
var views = { |
|
|
|
|
custom_boosts: require('./view/boost_sources_and_layers'), |
|
|
|
|
ngrams_strict: require('./view/ngrams_strict'), |
|
|
|
|
ngrams_last_token_only: require('./view/ngrams_last_token_only'), |
|
|
|
|
phrase_first_tokens_only: require('./view/phrase_first_tokens_only'), |
|
|
|
@ -45,18 +47,8 @@ query.score( peliasQuery.view.focus( views.ngrams_strict ) );
|
|
|
|
|
query.score( peliasQuery.view.popularity( views.pop_subquery ) ); |
|
|
|
|
query.score( peliasQuery.view.population( views.pop_subquery ) ); |
|
|
|
|
|
|
|
|
|
const boostView = require( './view/boost_sources_and_layers' ); |
|
|
|
|
|
|
|
|
|
const boostConfig = {}; //TODO: empty config to make functional tests pass for now
|
|
|
|
|
// example useful config:
|
|
|
|
|
//const boostConfig = {
|
|
|
|
|
//layer: {
|
|
|
|
|
//stops: 5,
|
|
|
|
|
//fare: 5,
|
|
|
|
|
//station: 1
|
|
|
|
|
//},
|
|
|
|
|
//};
|
|
|
|
|
query.score( boostView(boostConfig) ); |
|
|
|
|
const boostConfig = config.customBoosts || {}; |
|
|
|
|
query.score( views.custom_boosts(config.customBoosts) ); |
|
|
|
|
|
|
|
|
|
// non-scoring hard filters
|
|
|
|
|
query.filter( peliasQuery.view.sources ); |
|
|
|
|