From ec104a1bb274fc1d45bc0b6f9d1fe3b26c592f3b Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Fri, 14 Nov 2014 16:24:32 +0100 Subject: [PATCH] Sense: updated range filter/query to use gt(e)/lt(e) also removed numeric_range filter (replace by execution mode of the rang filter. Closes #306 --- sense/app/kb/api_1_0/filter.js | 50 ++++++++++------------------------ sense/app/kb/api_1_0/query.js | 21 ++++++-------- 2 files changed, 23 insertions(+), 48 deletions(-) diff --git a/sense/app/kb/api_1_0/filter.js b/sense/app/kb/api_1_0/filter.js index 3b74b2396e6cf..bc379855a0b42 100644 --- a/sense/app/kb/api_1_0/filter.js +++ b/sense/app/kb/api_1_0/filter.js @@ -300,23 +300,25 @@ define(function () { }; - filters.numeric_range = { + filters.range = { __template: { 'FIELD': { - from: 10, - to: 20 + gte: 10, + lte: 20 } }, "{field}": { - from: 1, - to: 20, - include_lower: { - __one_of: [true, false] - }, - include_upper: { - __one_of: [true, false] - } - } + gte: 1, + gt: 1, + lte: 20, + lt: 20, + time_zone: "+1:00", + execution: { __one_of: ["index", "fielddata"]} + }, + _cache: { + __one_of: [false, true] + }, + _cache_key: "" }; @@ -366,30 +368,6 @@ define(function () { } }; - - filters.range = { - __template: { - 'FIELD': { - from: 10, - to: 20 - } - }, - "{field}": { - from: 1, - to: 20, - include_lower: { - __one_of: [true, false] - }, - include_upper: { - __one_of: [true, false] - }, - _cache: { - __one_of: [false, true] - } - } - }; - - filters.script = { __template: { script: 'SCRIPT', diff --git a/sense/app/kb/api_1_0/query.js b/sense/app/kb/api_1_0/query.js index a505fd62e7ea5..34056101bf12b 100644 --- a/sense/app/kb/api_1_0/query.js +++ b/sense/app/kb/api_1_0/query.js @@ -343,23 +343,20 @@ define(["_"], function (_) { range: { __template: { 'FIELD': { - from: 10, - to: 20 + gte: 10, + lte: 20 } }, '{field}': { __template: { - from: 10, - to: 20 - }, - from: 1, - to: 20, - include_lower: { - __one_of: [true, false] - }, - include_upper: { - __one_of: [true, false] + gte: 10, + lte: 20 }, + gte: 10, + gt: 10, + lte: 20, + lt: 20, + time_zone: "+1:00", boost: 1.0 } },