Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Sense: updated range filter/query to use gt(e)/lt(e)
Browse files Browse the repository at this point in the history
also removed numeric_range filter (replace by execution mode of the rang filter.

Closes elastic#306
  • Loading branch information
bleskes committed Nov 14, 2014
1 parent c269273 commit ec104a1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 48 deletions.
50 changes: 14 additions & 36 deletions sense/app/kb/api_1_0/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
};


Expand Down Expand Up @@ -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',
Expand Down
21 changes: 9 additions & 12 deletions sense/app/kb/api_1_0/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
Expand Down

0 comments on commit ec104a1

Please sign in to comment.