Questions tagged [elasticsearch-aggregation]
1111 questions
0
votes
1 answer
ES term aggregation with total count, count per bucket and filtered results
I'm quite new to Elasticsearch and want to accomplish the following using term aggregation:
Get a list of products matching a category and selected specifications (features)
A list of specifications and possible values, with a count of products you…

Tum
- 6,937
- 2
- 25
- 23
0
votes
1 answer
How to perform multiple aggregation on an object in Elasticsearch using Python?
I want to perform date histogram query on my Elasticsearch data which is of the format:
datetime,field_obj and field_obj has three fields in it: a,b,c
Alongside date histogram aggregation, I want to find the average of field_obj i.e avg(field_a),…

Amogh Mishra
- 1,088
- 1
- 16
- 25
0
votes
1 answer
Filter elasticsearch bucket aggregation based on term field
I have a list of products (deal entities) and I'm attempting to create a bucket aggregation by categories, ordered by the sum of available_stock.
This all works fine, but I want to exclude such categories from the resulting aggregation that don't…

CrazyMuffin
- 46
- 5
0
votes
1 answer
Elasticsearch - Get top 'n' values & perform aggregation
I have an index from which I would like to search for a text & get top 100 results and perform aggregation to retrieve the uniqueIds from those 100 results & sort them by their max_value/sum_value. At present I am using the query below which…

Raja Rajan
- 81
- 6
0
votes
0 answers
How to efficiently determine if there are any terms at all in search results
I'm wondering if ElasticSearch has an aggregation that returns whether or not a field has any terms (i.e. if the terms aggregation will return an empty list or not). Obviously I can use a terms aggregation and check if there are any results, but I…

Robert Wille
- 189
- 1
- 12
0
votes
2 answers
Aggregation by nested objects with filter in ElasticSearch 6
I have set of documents that represent property units in ElasticSearsh 6. Every property has nested array of weekly rates:
{
"name" : "Completely Awesome Cabin"
"rates" : [
{
"start": "2018-06-09T00:00:00",
"end":…

KozhevnikovDmitry
- 1,660
- 12
- 27
0
votes
1 answer
elasticsearch aggs not working on some fields
Mapping
{
"products":{
"mappings":{
"product":{
"dynamic":"strict",
"properties":{
"CompanyId":{
"type":"integer"
},
"CompanyName":{
…

Richard Barraclough
- 2,625
- 3
- 36
- 54
0
votes
1 answer
Grouping with Elasticsearch (aggs) to join a field into a list of values
I have an index with several types. The data in each record includes fields like "Customer ID" and "Device Name", "url" etc.
Elasticsearch is v5.6.8.
What I'd like to end up with is one document per "Customer ID" and "Device Name" and the value of…

TheZeke
- 706
- 7
- 16
0
votes
1 answer
Bucket aggregation for an object instead of keyword
I have documents in my index which have a nested object locations in them.
"locations": [
{
"name": "California",
"coordinates": {
"lat": 36.78,
"long": -119.42
}
}, ...
]
I have written a…

Carasel
- 2,740
- 5
- 32
- 51
0
votes
1 answer
Successive aggregation elasticsearch java API
I've an a successive set of aggregations in a search request :
"aggs": {
"nested_max": {
"nested": {
"path": "questionResponses"
},
"aggs": {
"filter_max": {
"filter": {
…

Omarkad
- 279
- 3
- 14
0
votes
1 answer
Elasticsearch aggregation on nested (not array) field
Something is not quite clear to me about aggregations on nested fields that are not arrays but simple objects.
Let's consider the simple case scenario where I have a nested fields with languages + the normalized_name (that acts as some sort of ID)
#…

Cyril Duchon-Doris
- 12,964
- 9
- 77
- 164
0
votes
2 answers
Document count greater than 'x', geo_point aggregations elasticsearch
I'm currently doing the following Query to aggregate all points within a certain precision in elastic search.
{
"aggs": {
"coordinates": {
"geohash_grid": {
"field": "properties.Geometry.geo_point",
"precision": 12
…

Juliano Grams
- 525
- 1
- 5
- 17
0
votes
0 answers
cumulative sum of derivatives
I am currently using elastic for storing time series of of data where I am storing the incoming packets( it is incremental counter) on a port->network device .
I am doing aggregations to calculate number of packets received during a time…

Naidu
- 245
- 1
- 4
- 13
0
votes
1 answer
Count Unique Objects
My index looks like this:
"_source": {
"ProductName": "Random Product Name",
"Views": {
"Washington": [
{ "4nce5bbszjfppltvc": "2018-04-07T18:25:16.160Z" },
{ "4nce5bba8jfpowm4i": "2018-04-07T18:05:39.714Z" },
{…

Grim Reaper
- 561
- 4
- 6
- 22
0
votes
1 answer
filter_duplicate_text not working aggregation query
I'm trying to replicate the filter_duplicate_text example from https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significanttext-aggregation.html.
These are my settings, mapping and documents:
PUT /ods
{
…

Alex Pereira
- 337
- 1
- 4
- 12