Questions tagged [elasticsearch-aggregation]
1111 questions
0
votes
1 answer
Elasticsearch Java API : Aggregation Filter for document counts
I want to implement an aggregation that only returns the documents whose frequency is above a certain threshold.
For instance, here is the aggregation to get all of the documents with their counts
AggregationBuilder aggregation =…

AbtPst
- 7,778
- 17
- 91
- 172
0
votes
0 answers
Reusing the fields in Elastisearch Aggregation
I am using elastic search 1.6.0.
Here is my aggregation query :
GET /a/dummydata/_search
{
"size": 0,
"aggs": {
"sum_trig_amber": {
"terms": {
"field": "TRIGGER_COUNT_AMBER"
}
…

Bond
- 165
- 2
- 15
0
votes
1 answer
Elasticsearch Cardinality Aggregation giving wrong results
The count of PARTY_ID in both the aggregation should be same.
In one case it is 3000 and the other case it is sum of all values (2675 + 244 + 41 + 6 + 2 = 2950 ) which are not equal.
What might be the reason ?
GET /test/data/_search
{
"size":…

Bond
- 165
- 2
- 15
0
votes
0 answers
elastic search groupby many fields aggregations
I wan't to achieve the following group by aggregation using elasticsearch. The SQL equivalent would be like (sort of):
SELECT MIN(unix_time) as min_utime, MAX(unix_time) as max_utime
FROM myindex
GROUP BY http_user, src
Would the aggregations be…

Apostolos
- 7,763
- 17
- 80
- 150
0
votes
0 answers
adding aggs in a query dict using python elasticsearch library
I am trying to add an aggs query in Python's sdk for elasticsarch. Btu I can't seem to be able to make it work. E.g
body = {
"query":{
"bool":{
"must_not":{
"term":{
"dst":"-"
…

Apostolos
- 7,763
- 17
- 80
- 150
0
votes
1 answer
ElasticSearch aggregation get hit with min date
How can I get hit with min date after aggregation?
I have aggregation by some field, then subAggregation(AggregationBuilders.min("createdDate") with this date and then topHits subAggregation. But it returns me 3 hits, not 1 with this value.

Squeez
- 919
- 2
- 12
- 30
0
votes
1 answer
compute over results of elasticsearch aggregations
i have a documents with following structure:
{
"ga:bounces": "1",
"timestamp": "20160811",
"viewId": "125287857",
"ga:percentNewSessions": "100.0",
"ga:bounceRate": "100.0",
"ga:avgSessionDuration": "0.0",
"ga:sessions": "1",
"user":…

anekix
- 2,393
- 2
- 30
- 57
0
votes
0 answers
ElasticSearch Java API sorting aggregation
I have terms aggregation and I need sort result buckets by another field (date). Or I need to add 2 sub aggregations with max (and top hit) and min (and top hit).
I didn't find any API that allows me to do this.
I think I can add max subAggregation…

Squeez
- 919
- 2
- 12
- 30
0
votes
1 answer
How to plot aggregated data in kibana
I'm a newbie to kibana.
I have following data stored in ES:
{
"_index": "test",
"_type": "impressions",
"_id": "AVZ4QLgkLqvQLIzbvF4e",
"_version": 1,
"_score": 1,
"_source": {
"campaign_id": "1011",
"count": 691,
"played_dt":…

shriyog
- 938
- 1
- 13
- 26
0
votes
1 answer
ElasticSearch: Agregation on a datetime field
I'm trying to get aggregated information from a datetime field:
Get how many documents are there by month (NOT YEAR/MONTH!, ONLY MONTH): So, a 'groupby(month(datetime_field))'.
Thanks for all.

Jordi
- 20,868
- 39
- 149
- 333
0
votes
1 answer
Aggregation on a field and return the sum in elasticsearch
I am working to find the way to do aggregations on a field after filtering on an another filed. But, the Elastic search documentation is not easily understandable.
Lets say My Mapping:
[
{
a:'a1'
b:'b1'
c:120
d:12
},
{
…

Jack Daniel
- 2,527
- 3
- 31
- 52
0
votes
0 answers
How to do ES Moving Avearge Prediction with Logstash?
I am using Elasticsearch 2.3.2, and Logstash 2.3.3. I have found from https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-movavg-aggregation.html which states that moving average can do predictions. I know it…

Kennedy Kan
- 273
- 1
- 7
- 20
0
votes
1 answer
How to count elements by cardinality in elasticsearch?
Suppose I have a mapping that stores physical attributes of people, and a field in that mapping that is the user id. For instance:
"attributes": {
"hair_color": {
"type": "string"
},
"eyes_color": {
"type":…

AArias
- 2,558
- 3
- 26
- 36
0
votes
2 answers
ClassCastException[null] when grouping on a particular field
I am trying to group the results on a particular field by using the following query:
{
"from": 0,
"size": 0,
"fields": [
"exitPage.categoryId"
],
"aggs": {
"check": {
"terms": {
"field":…

Ankur
- 2,171
- 23
- 29
0
votes
1 answer
Elasticsearch 1.7 Document type aggregation
I'm trying to get an aggregation of the document types in our date store. Looking at the 1.7 Type Filter documentation, its as simple using a type filter. However, I run into the following issue trying to submit that query:
curl -XGET…

Jesse
- 2,043
- 9
- 28
- 45