From 74419bddc10988d1b9a1ed5891796e8cc82083ee Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Thu, 29 Jun 2017 11:36:03 -0400 Subject: [PATCH] added support for focus-only function --- query/address_search_using_ids.js | 2 +- test/unit/query/address_search_using_ids.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/query/address_search_using_ids.js b/query/address_search_using_ids.js index 2f14a043..9dbf1633 100644 --- a/query/address_search_using_ids.js +++ b/query/address_search_using_ids.js @@ -10,7 +10,7 @@ const check = require('check-types'); const addressUsingIdsQuery = new peliasQuery.layout.AddressesUsingIdsQuery(); // scoring boost -// addressUsingIdsQuery.score( peliasQuery.view.focus_only_function( peliasQuery.view.phrase ) ); +addressUsingIdsQuery.score( peliasQuery.view.focus_only_function( peliasQuery.view.phrase ) ); addressUsingIdsQuery.score( peliasQuery.view.popularity_only_function ); addressUsingIdsQuery.score( peliasQuery.view.population_only_function ); // -------------------------------- diff --git a/test/unit/query/address_search_using_ids.js b/test/unit/query/address_search_using_ids.js index f6d623e2..2e687dbd 100644 --- a/test/unit/query/address_search_using_ids.js +++ b/test/unit/query/address_search_using_ids.js @@ -15,6 +15,7 @@ module.exports.tests.interface = (test, common) => { // helper for canned views const views = { + focus_only_function: () => 'focus_only_function', popularity_only_function: 'popularity_only_function view', population_only_function: 'population_only_function view', boundary_country: 'boundary_country view', @@ -58,6 +59,7 @@ module.exports.tests.base_query = (test, common) => { t.equals(generatedQuery.body.vs.var('size').toString(), 20); t.deepEquals(generatedQuery.body.score_functions, [ + 'focus_only_function', 'popularity_only_function view', 'population_only_function view' ]);