From b9c4c673f52e9f8bc2d1eb631120f7c9c2e741f7 Mon Sep 17 00:00:00 2001 From: Harish Krishna Date: Mon, 13 Jul 2015 16:42:26 -0400 Subject: [PATCH] Revert "removing searchType overhead" This reverts commit ee4aa1b97a5661842b00f76898214b99e242dbce. --- controller/search.js | 1 + test/unit/controller/search.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/controller/search.js b/controller/search.js index 01e2f2ba..fdfecf09 100644 --- a/controller/search.js +++ b/controller/search.js @@ -13,6 +13,7 @@ function setup( backend, query ){ // backend command var cmd = { index: 'pelias', + searchType: 'dfs_query_then_fetch', body: query( req.clean ) }; diff --git a/test/unit/controller/search.js b/test/unit/controller/search.js index 00efd785..11b7515d 100644 --- a/test/unit/controller/search.js +++ b/test/unit/controller/search.js @@ -43,7 +43,7 @@ module.exports.tests.functional_success = function(test, common) { test('functional success', function(t) { var backend = mockBackend( 'client/search/ok/1', function( cmd ){ - t.deepEqual(cmd, { body: { a: 'b' }, index: 'pelias' }, 'correct backend command'); + t.deepEqual(cmd, { body: { a: 'b' }, index: 'pelias', searchType: 'dfs_query_then_fetch' }, 'correct backend command'); }); var controller = setup( backend, mockQuery() ); var res = { @@ -97,7 +97,7 @@ module.exports.tests.functional_success = function(test, common) { test('functional success (with details)', function(t) { var backend = mockBackend( 'client/search/ok/1', function( cmd ){ - t.deepEqual(cmd, { body: { a: 'b', details: true }, index: 'pelias' }, 'correct backend command'); + t.deepEqual(cmd, { body: { a: 'b', details: true }, index: 'pelias', searchType: 'dfs_query_then_fetch' }, 'correct backend command'); }); var controller = setup( backend, mockQuery() ); var res = { @@ -122,7 +122,7 @@ module.exports.tests.functional_success = function(test, common) { module.exports.tests.functional_failure = function(test, common) { test('functional failure', function(t) { var backend = mockBackend( 'client/search/fail/1', function( cmd ){ - t.deepEqual(cmd, { body: { a: 'b' }, index: 'pelias' }, 'correct backend command'); + t.deepEqual(cmd, { body: { a: 'b' }, index: 'pelias', searchType: 'dfs_query_then_fetch' }, 'correct backend command'); }); var controller = setup( backend, mockQuery() ); var next = function( message ){