Questions tagged [elasticsearch-aggregation]
1111 questions
0
votes
1 answer
Aggregation on different document type
i'm trying to solve a problem here, I'm not even sure it can be done how I want it to be done.
Basically I need to query my index on the type Company. This type does have a field named Company_Name. Now I have another type which is Employee that…

Christophe Schutz
- 605
- 4
- 19
0
votes
1 answer
Elastic search(2.4) - search and aggregate over arrays
I have a index with mapping as -
GET /sampledesc/desc/_mapping
{
"sampledesc": {
"mappings": {
"desc": {
"properties": {
"labels": {
"type": "string",
"index": "not_analyzed"
},
…

spiralarchitect
- 880
- 7
- 19
0
votes
1 answer
Pick dataset at samples in elasticsearch
I've a dataset with say 1000 dates spanning over a period of 1 month. I'd like to do an aggregation based on this date field but on only few samples separated by an interval(say week).
For ex: For dates ranging from 1-dec to 30-dec, i should get…

Jai Sharma
- 713
- 1
- 4
- 17
0
votes
1 answer
Elasticsearch aggregation return always empty buckets [] (elasticsearch version 2.4.1)
I have the following code:
final String index = ElasticSearchUtils.getIndexNameForExecution(queryId);
SearchRequestBuilder query = client.prepareSearch(index);
query.setTypes(indexType.toString());
…

Andres Benavides
- 81
- 1
- 11
0
votes
0 answers
Elasticsearch : Alternate approach to get frequency count without using aggregation
We are trying to get the frequency count for search terms using aggregation. Since there are three keys for which we need to get the frequency count facing performance degrade with respect to search. How to get frequency count without aggregation?…

banu
- 31
- 1
- 1
- 6
0
votes
1 answer
Global term aggregation with filtered count - Elasticsearch 5
I have products stored in ES and I'm trying to aggregate them by their size. I would like to design following behaviour. For each term even outside of query to receive term counts based on query.
So querying for sizes ["S", "M"] I would like to…

Josef Rousek
- 11
- 6
0
votes
3 answers
Is it possible to returns other fields when you aggregate results on Elasticsearch?
Here is the mappings of my index PublicationsLikes:
id : String
account : String
api : String
date : Date
I'm currently making an aggregation on ES where I group the results counts by the id (of the publication).
{
"key": "",
…

christophedebatz
- 184
- 3
- 16
0
votes
1 answer
Elasticsearch Aggregations: Volume-Weighted Average Price
I need to plot the Volume-Weighted Average Prive (VWAP) of trades having a price_per_unit and a quantitiy over a certain time range.
As a result of the aggregation every bucket of the date_histogram should contain the VWAP of the all trades that…

Bernhard Vallant
- 49,468
- 20
- 120
- 148
0
votes
1 answer
Sortorder in Elasticsearch
I have written elasticsearch query using java api in which status count is fetched per day.
Code:
SearchResponse responseOutput = client.prepareSearch(ConstantsValue.indexName)
.setTypes(ConstantsValue._Type)
.setFetchSource(new String[]{"STATUS",…

ASP
- 121
- 1
- 1
- 12
0
votes
1 answer
in elasticsearch how to write Aggregations terms in order to group by time per 5 minutes
some data in elasticsearch like this:
{"info":"fwefwefwef","is_fail":0,"result":404,"key":"845722d85520c91f345b08aba3233c96","duration":1,"lts_at":1479786902}
'lts_at is' timestamp, and i want to group by datas in 'floor(lts_at/300)'
{
"aggs": {
…
0
votes
2 answers
Elasticsearch Date range query with aggregation
I am trying to execute following query. I have 3 attributes in document
STATUS - Which can be "FAIL", "PASS" , "INVALID"
DATE - contains date and time.
I want daily number of count for each status
eg : Date : 11-09-2016, STATUS : FAIL, count: 120
…

ASP
- 121
- 1
- 1
- 12
0
votes
1 answer
Elasticsearch data to more structured form
I have a two field sub aggregations: `['field1', 'field2']. Both fields are term aggregations. The way elasticsearch returns aggregations isn't very convenient with all those buckets and nesting and bucket nesting. I am having troubles on…

Apostolos
- 7,763
- 17
- 80
- 150
0
votes
1 answer
Aggregate only newest document
I have an elastic index which has documents for user state history. Data looks like this;
{
"session_id": "yunus",
"state_name": "start",
"entry_time": "2016-11-09 15:27:03"
},
{
"session_id": "yunus",
"state_name": "end",
…

Fatih Donmez
- 4,319
- 3
- 33
- 45
0
votes
1 answer
elasticsearch, get frequency and number of element
I have an index with this kind of document:
{
"_id": "6827",
"_index": "test",
"_score": 1.0,
"_source": {
"class": [
{
"name":…

Gaut
- 1,255
- 2
- 15
- 33
0
votes
0 answers
Elastic search giving wrong results on bucket aggregation and then cardinality
I am writing an elastic search query to get the unique users in two different time periods. And also the total users. This is to identify unique users to the website for today.
What I am planning todo is calculate total users and users until…

itssiva
- 119
- 6