Browse Source

Merge pull request #154 from pelias/remove_exact_match

remove exact_match script
pull/155/head
Peter Johnson a.k.a. insertcoffee 10 years ago
parent
commit
263415ba80
  1. 13
      query/sort.js
  2. 10
      test/unit/query/search.js
  3. 18
      test/unit/query/sort.js

13
query/sort.js

@ -51,18 +51,5 @@ module.exports = function( params ){
} }
]; ];
if( isObject( params ) && params.hasOwnProperty( 'input' ) ){
scriptsConfig.push({
'_script': {
'params': {
'input': params.input
},
'file': 'exact_match',
'type': 'number',
'order': 'desc'
}
});
}
return scriptsConfig; return scriptsConfig;
}; };

10
test/unit/query/search.js

@ -58,16 +58,6 @@ var sort = [
'type': 'number', 'type': 'number',
'order': 'desc' 'order': 'desc'
} }
},
{
'_script': {
'params': {
'input': 'test'
},
'file': 'exact_match',
'type': 'number',
'order': 'desc'
}
} }
]; ];

18
test/unit/query/sort.js

@ -69,24 +69,6 @@ module.exports.tests.query = function(test, common) {
}); });
}; };
module.exports.tests.queryWithInput = function ( test, common ){
test( 'Valid sort query component when input is present.', function ( t ){
var expectedWithInput = expected.slice();
expectedWithInput.push({
_script: {
params: {
input: 'foobar'
},
file: 'exact_match',
type: 'number',
order: 'desc'
}
});
t.deepEqual(generate({ input: 'foobar' }), expectedWithInput, 'valid sort part of the query');
t.end();
});
};
module.exports.all = function (tape, common) { module.exports.all = function (tape, common) {
function test(name, testFunction) { function test(name, testFunction) {

Loading…
Cancel
Save