From 0cf282767a2531ffebc106a1e03e06977b18157a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 7 Jul 2015 16:00:03 +0200 Subject: [PATCH] remove exact_match script --- query/sort.js | 13 ------------- test/unit/query/search.js | 10 ---------- test/unit/query/sort.js | 18 ------------------ 3 files changed, 41 deletions(-) diff --git a/query/sort.js b/query/sort.js index 4bc38164..0ec13c15 100644 --- a/query/sort.js +++ b/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; }; diff --git a/test/unit/query/search.js b/test/unit/query/search.js index a56bafa1..7665f876 100644 --- a/test/unit/query/search.js +++ b/test/unit/query/search.js @@ -58,16 +58,6 @@ var sort = [ 'type': 'number', 'order': 'desc' } - }, - { - '_script': { - 'params': { - 'input': 'test' - }, - 'file': 'exact_match', - 'type': 'number', - 'order': 'desc' - } } ]; diff --git a/test/unit/query/sort.js b/test/unit/query/sort.js index 10f474ac..06f615b2 100644 --- a/test/unit/query/sort.js +++ b/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) { function test(name, testFunction) {