getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.
http://redash.io/
BSD 2-Clause "Simplified" License
26.32k stars 4.37k forks source link

Elasticsearch aggregations not working #3575

Open LuisDeHaro opened 5 years ago

LuisDeHaro commented 5 years ago

Issue Summary

When I try to run an aggregation query to the ES cluster directly it works, in Redash it doesn't.

Query:

{
    "query": {
        "match": {
            "user.email": "some@email.com"
        }
    },
    "aggs" : {
        "subtotal" : { "sum" : { "field" : "subtotal" } }
    },
    "size": 0
}

Expected output (when executed directly to the cluster):

{
  "took" : 6,
  "timed_out" : false,
  "_shards" : {
    "total" : 77,
    "successful" : 56,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 5,
    "max_score" : 0.0,
    "hits" : [ ]
  },
  "aggregations" : {
    "subtotal" : {
      "value" : 592.0
    }
  }
}

Steps to Reproduce

  1. Created a ES datasource successfully
  2. Running the above query
  3. 0 rows shown

Technical details:

arikfr commented 5 years ago

Aggregations have very limited support at the moment. There is a community member currently looking into improving the support and we plan to allocate resources to this too when we finish other ongoing projects.

LuisDeHaro commented 5 years ago

@arikfr, thanks for your response.

I've been using Redash connected with PGSQL and it works just perfect, amazing and beautifully.

However this week creating a new data source pointing to ElasticSearch I would say: it's not useful... needs a lot of improvement in order to just do the job.

I hope this get's fixed soon, I would like to use Redash for every data source I have now and in the future.

God bless Israel my friend.

lkm commented 5 years ago

@arikfr I wouldn't mind lending a hand to code and test this. Could you please point me to the community member's code so I don't repeat anything?