mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
migrate es api: statistics
This commit is contained in:
parent
697ea87e37
commit
f66ca9165e
@ -447,16 +447,9 @@ Application.Controllers.controller "StatisticsController", ["$scope", "$state",
|
|||||||
if custom
|
if custom
|
||||||
criterion = buildElasticCustomCriterion(custom)
|
criterion = buildElasticCustomCriterion(custom)
|
||||||
if (custom.exclude)
|
if (custom.exclude)
|
||||||
q = "query": {
|
q.query.bool.must_not = [
|
||||||
"filtered": {
|
"term": criterion.match
|
||||||
"query": q.query,
|
]
|
||||||
"filter": {
|
|
||||||
"not": {
|
|
||||||
"term": criterion.match
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
q.query.bool.must.push(criterion)
|
q.query.bool.must.push(criterion)
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class CustomAggregationService
|
|||||||
|
|
||||||
exclude = custom_query.delete('exclude')
|
exclude = custom_query.delete('exclude')
|
||||||
if exclude
|
if exclude
|
||||||
query = {query: { filtered: { query: query['query'], filter: { not: { term: custom_query['match'] } } } }, aggregations: query['aggregations'], size: query['size']}
|
query['query']['bool']['must_not'] = [{ term: custom_query['match'] }]
|
||||||
else
|
else
|
||||||
query['query']['bool']['must'].push(custom_query)
|
query['query']['bool']['must'].push(custom_query)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user