diff --git a/README.md b/README.md index 885c9b7b..04453c51 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ $ npm run unit ``` ### Running Functional Tests +(this requires the server to be running) ```bash $ npm run ciao diff --git a/controller/search.js b/controller/search.js index e86658f7..ff38a3a6 100644 --- a/controller/search.js +++ b/controller/search.js @@ -21,7 +21,7 @@ function setup( backend, query ){ // handle backend errors if( err ){ return next( err ); } - if( data && data.hits && data.hits.total){ + if( data && data.hits && data.hits.total && Array.isArray(data.hits.hits)){ docs = data.hits.hits.map( function( hit ){ return hit._source; }); diff --git a/query/search.js b/query/search.js index 2e505adb..3f9cdbf5 100644 --- a/query/search.js +++ b/query/search.js @@ -2,7 +2,7 @@ var logger = require('../src/logger'); // Build pelias search query function generate( params ){ - + var cmd = { "query":{ "query_string" : {