Questions tagged [elasticsearch-aggregation]
1111 questions
4
votes
0 answers
Apply Composite Aggregation on Filtered data
I'm using "Composite Aggregation" as my use case requires "Pagination" on buckets returned by Aggregation, as the number of returned buckets could be huge.
I also need to run "Composite aggregation" on a specific time range, I'm using a "range"…

codeseeker
- 85
- 2
- 5
4
votes
2 answers
ElasticSearch mapping the result of collapse / do operations on a grouped documents
There is a list of conversations and every conversation has a list of messages. Every message has different fields and an action field. We need to consider that in the first messages of the conversation there is used the action A, after a few…

Radu Linu
- 1,143
- 13
- 29
4
votes
1 answer
Custom Histogram aggregation in Elasticsearch
I have a index of following structure
item_id: unique item id
sale_date: date of the date
price: price of the sale wrt the date
I want to create a histogram of the latest sale prices per item. aggregate term item_id and histogram of last or latest…

Jugraj Singh
- 529
- 1
- 6
- 22
4
votes
1 answer
Significant terms aggregation over a list field against itself
I have documents of the following format:
{ "my_field": ["foo", "bar", "baz"] }
{ "my_field": ["foo", "baz"] }
{ "my_field": ["foo", "bar"] }
I would like to find out which my_field term pairs occur most commonly together. I have tried using…

Sash
- 4,448
- 1
- 17
- 31
4
votes
1 answer
Validate aggregate query in elasticsearch
I hope someone can explain me why I'm having this issue: I want to validate an ES (in version 7.4) query before launch it, every thing works fine if the query has no aggs clause but, if the query has aggs, ES says it's a no valid query, what is…

Francisco Moreno
- 229
- 1
- 6
4
votes
0 answers
Calculate the counts of last snapshot of a record in ElasticSearch
I am storing snapshots of data in ElasticSearch. I want to perform count metric aggregation on latest snapshot of each entry, the purpose is to know what state my current (latest) data are in
I have something like this
[
{
"id": 2,
…

Muhammad
- 921
- 2
- 11
- 29
4
votes
1 answer
How to using aggregations with composite for elasticsearch-dsl
i am using aggregations and aggregation bucket accept one key value as default then i research and find it
"aggs" : {
"my_buckets": {
"composite" : {
"sources" : [
{ "category_pk": { "terms": {…

Ozan Teoman Dayanan
- 81
- 1
- 7
4
votes
1 answer
Terms aggregation with nested wildcard path
Given the following nested object of nested objects
{
[...]
"nested_parent":{
"nested_child_1":{
"classifier":"one"
},
"nested_child_2":{
"classifier":"two"
},
"nested_child_3":{
"classifier":"two"
},
…

Joe - GMapsBook.com
- 15,787
- 4
- 23
- 68
4
votes
1 answer
How to aggregate on the same field:value which are specified in query in elasticsearch
So my data in elasticsearch looks like this one whole dict with one person id is equal to one doc and it contains list of objects like
`{
"dummy_name": "abc",
"dummy_id": "44850642"
}`
which is shown below ,the thing is I am querying on the…

glady
- 41
- 4
4
votes
1 answer
multiple filters on a single aggregation in elasticsearch
I am using elasticsearch on python client. I would like to filter on multiples field on the same aggregation bucket.
First, let's inject some data
curl -XPUT 'localhost:9200/data/document/1' -d '{ "facet1": ["a1","b1"],…

g.lahlou
- 468
- 3
- 15
4
votes
1 answer
Multiple aggregations in Elasticsearch
I want to do a terms aggregation on two fields. I don't want a sub-aggregations but I want results in two different bucket groups like if I did two separate queries for the two fields. Is it possible to combine these two queries into one?
First…

Berry Blue
- 15,330
- 18
- 62
- 113
4
votes
1 answer
elasticsearch terms and sum aggregation
I have documents in elasticsearch (1.5) that looks like:
{
"gender": [
{
"name": "unknown",
"value": 12
},
{
"name": "male",
"value": 89
},
{
…

Udy
- 2,492
- 4
- 23
- 33
4
votes
1 answer
elasticsearch: use aggregated value for filtering
I'm using nested mapping (below), that represents a "task" and has a nested element of "requests" making progress towards that task.
I'm trying to find all tasks which have not made progress, i.e. all documents for which the "max" aggregation on the…

aabes
- 208
- 1
- 12
4
votes
1 answer
Is it possible to put the results of an ElasticSearch aggregation back into the index?
So I have an index with ping data from host A to host B and my data looks like this:
{
"@version" => "1",
"@timestamp" => "2014-07-17T21:17:34.030Z",
"host" => "host_a",
"to_host" => "host_b",
"value" => "25.6",
"from_host" => "host_a",
…

alexpotato
- 1,168
- 2
- 9
- 28
3
votes
0 answers
OpenSearch Java Client: class org.glassfish.json.JsonProviderImpl cannot be cast to class jakarta.json.spi.JsonProvider
I am migrating from OpenSearch Java High Level REST Client v.2.2.1 to Java Client v.2.2.1.
The logic that I am rewriting builds filters values by concurrently issuing search aggregation requests to OpenSearch. For instance, filter Organization Name…

Hutsul
- 1,535
- 4
- 31
- 51