mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-17 11:54:22 +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
|
||||
criterion = buildElasticCustomCriterion(custom)
|
||||
if (custom.exclude)
|
||||
q = "query": {
|
||||
"filtered": {
|
||||
"query": q.query,
|
||||
"filter": {
|
||||
"not": {
|
||||
"term": criterion.match
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
q.query.bool.must_not = [
|
||||
"term": criterion.match
|
||||
]
|
||||
else
|
||||
q.query.bool.must.push(criterion)
|
||||
|
||||
|
@ -29,7 +29,7 @@ class CustomAggregationService
|
||||
|
||||
exclude = custom_query.delete('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
|
||||
query['query']['bool']['must'].push(custom_query)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user