Browse Source

added support for focus-only function

pull/912/head
Stephen Hess 8 years ago
parent
commit
74419bddc1
  1. 2
      query/address_search_using_ids.js
  2. 2
      test/unit/query/address_search_using_ids.js

2
query/address_search_using_ids.js

@ -10,7 +10,7 @@ const check = require('check-types');
const addressUsingIdsQuery = new peliasQuery.layout.AddressesUsingIdsQuery(); const addressUsingIdsQuery = new peliasQuery.layout.AddressesUsingIdsQuery();
// scoring boost // 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.popularity_only_function );
addressUsingIdsQuery.score( peliasQuery.view.population_only_function ); addressUsingIdsQuery.score( peliasQuery.view.population_only_function );
// -------------------------------- // --------------------------------

2
test/unit/query/address_search_using_ids.js

@ -15,6 +15,7 @@ module.exports.tests.interface = (test, common) => {
// helper for canned views // helper for canned views
const views = { const views = {
focus_only_function: () => 'focus_only_function',
popularity_only_function: 'popularity_only_function view', popularity_only_function: 'popularity_only_function view',
population_only_function: 'population_only_function view', population_only_function: 'population_only_function view',
boundary_country: 'boundary_country 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.equals(generatedQuery.body.vs.var('size').toString(), 20);
t.deepEquals(generatedQuery.body.score_functions, [ t.deepEquals(generatedQuery.body.score_functions, [
'focus_only_function',
'popularity_only_function view', 'popularity_only_function view',
'population_only_function view' 'population_only_function view'
]); ]);

Loading…
Cancel
Save