1
0
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:
Sylvain 2018-06-08 12:27:01 +02:00
parent 697ea87e37
commit f66ca9165e
2 changed files with 4 additions and 11 deletions

View File

@ -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)

View File

@ -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