Questions tagged [elasticsearch-aggregation]

1111 questions
0
votes
1 answer

Further filtering of aggregations

I have a question regarding aggregation in elastic search. I have a document like the following: { "_index": "products", "_type": "product", "_id": "ID-12345", "_score": 1, "_source": { "created_at": "2017-08-04T17:56:44.592Z", …
David Ambler
  • 133
  • 1
  • 1
  • 9
0
votes
1 answer

How to aggregate field if specify field existing

I have documents like this { "_index": "message_2017-08", "_type": "comment", "_id": "c000001", "_source": { "companies": { "58f99f99ba63d10006291b59": { "id":…
Bongsakorn
  • 27
  • 6
0
votes
1 answer

ElasticSearch: aggregation filtering

For simplicity suppose I have index from 3 rows in elastic: {"id": 1, "tags": ["t1", "t2", "t3"]}, {"id": 2, "tags": ["t1", "t4", "t5"]} I need to aggregate by some tags without returning result of other tags in matching documents: { "aggs": { …
Vitalii Ponomar
  • 10,686
  • 20
  • 60
  • 88
0
votes
1 answer

elasticsearch nested aggregate based on attribute and get custom value based on a formula in every bucket

I have dataset of Event actions: {"person" : "person1", "event" : "e1", "action" : "like"} {"person" : "person2", "event" : "e1", "action" : "dislike"} {"person" : "person1", "event" : "e1", "action" : "share"} {"person" : "person1", "event" :…
Divya Sriram
  • 138
  • 6
0
votes
1 answer

Aggregation using elastic search

I have my search query for fetch latest 5000 documents from my elastic DB as below { "size": 5000, "from": 0, "query": { "range" : { "hostTimestamp" : { "gte" : 1499674634382, "lte" :…
0
votes
1 answer

ElasticSearch Aggregation on nested field with bucketing on parent id

Following is my doc structure 'Order': { u'properties': { u'order_id': {u'type': u'integer'}, 'Product': { u'properties': { u'product_id': {u'type': u'integer'}, …
himanshu219
  • 654
  • 7
  • 22
0
votes
1 answer

elasticsearch: running a script over top hits aggregation fields

I want to perform a terms aggregation and in every results bucket get the hit fields after a script manipulation was performed. For example, if these are the documents: {"age": 15, "firstName": "Dana", "lastName": "Miller"} {"age": 15, "firstName":…
Shani
  • 57
  • 7
0
votes
1 answer

Elasticsearch aggregation with reverse_nested path parameter

Could anybody elaborate more on the "path" param in reverse_nested tag in elasticsearch aggregation? I am trying to aggregated nested buckets using keys in different nesting level. Here are the details: Creating an index with following mapping PUT…
0
votes
1 answer

How to get Elasticsearch aggregates to ignore filters the in similar way as Solr facets

In Solr, you can keep the counts for certain facets despite filters being set. Is there a way to enable similar functionality for Elasticsearch Aggregates? (I have found a few examples for the now discontinued Elasticsearch facets, but i think this…
Fontanka16
  • 1,161
  • 1
  • 9
  • 37
0
votes
1 answer

Elasticsearch count of documents with values in range

I have a set of documents where each have min and max numerical fields, such as { min: 50, max: 100 }, { min: 75, max: 125 }, { min: 75, max: 150 }, ... I know beforehand what the highest possible max value can be. What I'd like to do is a bucket…
alan
  • 870
  • 7
  • 24
0
votes
1 answer

Boosting elastic aggregation result

I have an elastic index for products, each product has Brand attribution and I "have to" create an aggregation that returns Brands of the products. My Sample Query: GET /products/product/_search { "size": 0, "aggs": { "myFancyFilter": { …
0
votes
0 answers

Calculate Average of an Array's indexes in ElasticSearch

I am trying to calculate average of the result set that is returning me locations from Elastic Search. Here is what i am trying. 'aggs' => [ "avg_location" => [ 'avg' => [ 'field' => 'location' …
Omicans
  • 531
  • 1
  • 8
  • 26
0
votes
1 answer

elasticsearch multi-word significant terms aggregation

I'm trying to run a significant terms aggregation on documents that have been tagged with keywords. The problem is that some of these tags consist of multiple words. An example of such a tag might be 'markup languages', however the aggregation…
0
votes
1 answer

Aggregations elasticsearch 5

In my elastic search index has following type of entries. { "_index": "employees", "_type": "employee", "_id": "10000", "_score": 1.3640093, "_source": { "itms": { "depc": [ "IT", "MGT", "FIN" ], …
Rose18
  • 2,892
  • 8
  • 47
  • 98
0
votes
0 answers

max from aggregated results elasticsearch

i am using elastic search to perform a simple aggregation. this aggreagtion gives total transactions from each country: { "query": { "match_all": {} }, "aggs": { "distribution": { "terms": { "field": "country" }, …
anekix
  • 2,393
  • 2
  • 30
  • 57