Browse Source

renamed files to be more indicative of what the function is

pull/712/head
Stephen Hess 8 years ago
parent
commit
08f4aa4b95
  1. 2
      query/component_geocoding.js
  2. 13
      routes/v1.js
  3. 0
      sanitizer/component_geocoding.js
  4. 0
      test/unit/query/component_geocoding.js
  5. 2
      test/unit/run.js
  6. 2
      test/unit/sanitizer/component_geocoding.js

2
query/component.js → query/component_geocoding.js

@ -102,7 +102,7 @@ function generateQuery( clean ){
var q = getQuery(vs); var q = getQuery(vs);
console.log(JSON.stringify(q.body, null, 2)); // console.log(JSON.stringify(q.body, null, 2));
return q; return q;
} }

13
routes/v1.js

@ -8,7 +8,7 @@ var sanitizers = {
place: require('../sanitizer/place'), place: require('../sanitizer/place'),
search: require('../sanitizer/search'), search: require('../sanitizer/search'),
search_fallback: require('../sanitizer/search_fallback'), search_fallback: require('../sanitizer/search_fallback'),
component: require('../sanitizer/component'), component_geocoding: require('../sanitizer/component_geocoding'),
reverse: require('../sanitizer/reverse'), reverse: require('../sanitizer/reverse'),
nearby: require('../sanitizer/nearby') nearby: require('../sanitizer/nearby')
}; };
@ -30,7 +30,7 @@ var controllers = {
var queries = { var queries = {
libpostal: require('../query/search'), libpostal: require('../query/search'),
fallback_to_old_prod: require('../query/search_original'), fallback_to_old_prod: require('../query/search_original'),
component: require('../query/search_component') component_geocoding: require('../query/component_geocoding')
}; };
/** ----------------------- controllers ----------------------- **/ /** ----------------------- controllers ----------------------- **/
@ -96,14 +96,9 @@ function addRoutes(app, peliasConfig) {
postProc.sendJSON postProc.sendJSON
]), ]),
component: createRouter([ component: createRouter([
sanitizers.component.middleware, sanitizers.component_geocoding.middleware,
middleware.calcSize(), middleware.calcSize(),
// 2nd parameter is `backend` which gets initialized internally controllers.search(peliasConfig, undefined, queries.component_geocoding),
// 3rd parameter is which query module to use, use fallback/geodisambiguation
// first, then use original search strategy if first query didn't return anything
controllers.search(peliasConfig, undefined, queries.component),
// sanitizers.search_fallback.middleware,
// controllers.search(peliasConfig, undefined, queries.fallback_to_old_prod),
postProc.trimByGranularityComponent(), postProc.trimByGranularityComponent(),
postProc.distances('focus.point.'), postProc.distances('focus.point.'),
postProc.confidenceScores(peliasConfig), postProc.confidenceScores(peliasConfig),

0
sanitizer/component.js → sanitizer/component_geocoding.js

0
test/unit/query/component.js → test/unit/query/component_geocoding.js

2
test/unit/run.js

@ -59,7 +59,7 @@ var tests = [
require('./sanitizer/nearby'), require('./sanitizer/nearby'),
require('./src/backend'), require('./src/backend'),
require('./sanitizer/autocomplete'), require('./sanitizer/autocomplete'),
require('./sanitizer/component'), require('./sanitizer/component_geocoding'),
require('./sanitizer/place'), require('./sanitizer/place'),
require('./sanitizer/reverse'), require('./sanitizer/reverse'),
require('./sanitizer/sanitizeAll'), require('./sanitizer/sanitizeAll'),

2
test/unit/sanitizer/component.js → test/unit/sanitizer/component_geocoding.js

@ -8,7 +8,7 @@ module.exports.tests.sanitize = function(test, common) {
// rather than re-verify the functionality of all the sanitizers, this test just verifies that they // rather than re-verify the functionality of all the sanitizers, this test just verifies that they
// were all called correctly // were all called correctly
var search = proxyquire('../../../sanitizer/component', { var search = proxyquire('../../../sanitizer/component_geocoding', {
'../sanitizer/_deprecate_quattroshapes': function() { '../sanitizer/_deprecate_quattroshapes': function() {
called_sanitizers.push('_deprecate_quattroshapes'); called_sanitizers.push('_deprecate_quattroshapes');
return { errors: [], warnings: [] }; return { errors: [], warnings: [] };
Loading…
Cancel
Save