1
0
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:
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 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)

View File

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