Severyn Kozak 10 years ago
parent
commit
f9670bf7e4
  1. 3
      query/sort.js

3
query/sort.js

@ -2,6 +2,7 @@ var admin_boost = 'admin_boost';
var population = 'population'; var population = 'population';
var popularity = 'popularity'; var popularity = 'popularity';
var weights = require('pelias-suggester-pipeline').weights; var weights = require('pelias-suggester-pipeline').weights;
var isObject = require( 'is-object' );
module.exports = function( params ){ module.exports = function( params ){
var scriptsConfig = [ var scriptsConfig = [
@ -38,7 +39,7 @@ module.exports = function( params ){
} }
]; ];
if( typeof params === 'object' && params.hasOwnProperty( 'input' ) ){ if( isObject( params ) && params.hasOwnProperty( 'input' ) ){
scriptsConfig.push({ scriptsConfig.push({
_script: { _script: {
params: { params: {

Loading…
Cancel
Save