Questions tagged [elasticsearch-aggregation]
1111 questions
0
votes
0 answers
Elastic Search Aggregation Query of multiple levels optimization
Need an better way or optimized query to retrieve the statuses of each level.
we are trying to get the aggregation data of IoT devices status from a huge volume stored in the ES. The data in the storage will be like…

Rakesh Allampati
- 7
- 4
0
votes
0 answers
Elasticsearch query on IDs with message filtering + not exists filter on different message
I need to query some Elastisearch logs based on message and id.
The simplified scenario is the following: each minute a case is worked. If it is completed we have a log "COMPLETED", otherwise "NOT COMPLETED".
Cases can be reprocessed, so a…

Carlo Leone
- 1
- 2
0
votes
1 answer
Elasticsearch aggregation keep whitespaces
I have the last version of elasticsearch (6.5.x).
I want to to keep the full string for a field in aggregation .
For example : "New York" in aggregation give "new" and "york".
I want to keep "New York".
In old version, we had to use index:…

ArGh
- 1,148
- 1
- 11
- 20
0
votes
1 answer
Weighted Average for nested aggregation in Elastic Search
I am trying to obtain the weighted average by aggregating a nested list.
Each document has details of a single student, and the subjects vary across each student and each subject has different weights.
I am trying to calculate the weighted average…

User54211
- 121
- 2
- 11
0
votes
1 answer
Multiple key aggregation in ElasticSearch
I am new to Elastic Search and was exploring aggregation query. The documents I have are in the format -
{"name":"A",
"class":"10th",
"subjects":{
"S1":92,
"S2":92,
"S3":92,
}
}
We have about 40k such…

User54211
- 121
- 2
- 11
0
votes
1 answer
Elasticsearch aggregation on values in nested list (array)
I have stored some values in Elasticsearch nested data type (an array) but without using key/value pair. An example record would be:
{
"categories": [
"Category1",
"Category2"
],
"product_name": "productx"
}
Now I want to run aggregation…

Sameera Godakanda
- 109
- 3
- 8
0
votes
1 answer
Elasticsearch - Query field against aggregation
I am exploring the ease of querying and aggregating the data using elasticsearch. But i am not able to pivot and aggregate the data in a single query as below:
Considering the data:
Is there a way to query the below result
that pivots and…

Gowtham
- 13
- 3
0
votes
0 answers
Elastic Terms aggregation return 0 with keyword
below aggregation returns 0 even when I have data in index.
GET index_name/index_type/_search
{
"size": 0,
"aggs": {
"trms": {
"terms": {
"field": "su_name.keyword",
"size": 10
}
}
}
}
Following is the mapping of this…

Shrivats
- 53
- 7
0
votes
0 answers
The cheapest price for every search result Elasticsearch
I'm making a pricecomparison website. Many products has multiple webshops (prices). For each result based on a match query, I want to return the cheapest price of each result.
For example: the match query returns 30 results based on the title:…

jurh
- 420
- 1
- 4
- 17
0
votes
1 answer
null_pointer_exception when using elastic aggregations (NEST)
I want to present facets using elastic (6.2.4).
a facet should present a value and the number of documents that contain this value for each value in a specific field (ordered by the number of documents desc).
Based on the documentation I think I…

Omri
- 887
- 8
- 24
0
votes
1 answer
Get Values of fields from Indices of Elastic Search that are not used in Aggregations
I am using aggregations in Elastic Search. I want a value of field which is not being used in the aggregations. I know there is one to one mapping between the field that is being used in the grouping and the field i require. So, is there a way i can…
0
votes
0 answers
How to use price range with nested query in ElasticSearch?
How to use Price Range in elastic search query
Here is my query:
{
"query": {
"nested": {
"path": "prices",
"query": {
"bool": {
"must": {
"range": {
"prices.price": {
…

Jamin
- 133
- 12
0
votes
2 answers
Elastic-search: Search for a specific record without scrolling through all the data
Problem: traversing through more than 10,000 results in elastic search for a search query.
Is there anyway we can search a specific item without traversing/retrieving whole elastic search database. I came across scrolling but that is a memory…

ahmedwaleedmalik
- 73
- 2
- 7
0
votes
0 answers
Elasticsearch 6.4 scripted_metric aggregation Bad performance against ElasticSearch 5.1
I have 2 clusters of ElasticSearch:
old 3 nodes(master+data)
ElasticSearch: 5.1.2
java : openjdk version "1.8.0_111"
-Xms12g -Xmx12g
new 6 nodes(3 master + 3 data) with much better hardware (cpu/ram/hdd)
ElasticSearch: 6.4
java : openjdk…

user3283133
- 11
- 1
- 3
0
votes
1 answer
elasticsearch aggregation on aggregation
I have some indexed records like these:
{
song_id: 123,
user_id: 1000,
date: "2018-06-04T16:01:20"
},{
song_id: 123,
user_id: 1000,
date: "2018-05-03T14:21:17"
},{
song_id: 123,
user_id: 1001,
date: "2018-05-25T22:54:37"
},{
song_id: 124,
…

Mehmed
- 9
- 1
- 4