# Elastic search queries working for \_search endpoint are not working for query DSL filter in Kibana

**URL:** https://discuss.elastic.co/t/elastic-search-queries-working-for-search-endpoint-are-not-working-for-query-dsl-filter-in-kibana/304569
**Category:** Elasticsearch
**Created:** [May 12, 2022, 12:15pm UTC](https://discuss.elastic.co/t/elastic-search-queries-working-for-search-endpoint-are-not-working-for-query-dsl-filter-in-kibana/304569 "2022-05-12T12:15:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Noman\_Saleem](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/noman_saleem/32/105422_2.png) [@Noman\_Saleem](https://discuss.elastic.co/u/Noman_Saleem)
#### Post date: [May 12, 2022, 12:15pm UTC](https://discuss.elastic.co/t/elastic-search-queries-working-for-search-endpoint-are-not-working-for-query-dsl-filter-in-kibana/304569/1 "2022-05-12T12:15:34Z")

</div>

Hi, I am trying to run the query on query DSL Kibana but its not working but the same query is working for the \_search endpoint. Here is the query.

```auto
{ 
    "size": 0,
    "query": {
        "range": {
            "timestamp": {
                "gte": "2021-03-30T00:00:00.000Z",
                "lte": "2021-12-06T00:00:00.000Z",
                "time_zone": "Z",
                "boost": 1.0
            }
        }
    },
    "_source": false,
    "aggregations": {
        "groupby": {
            "composite": {
                "size": 10,
                "sources": [
                    {
                        "e88a97fe": {
                            "terms": {
                                "field": "timestamp",
                                "missing_bucket": true,
                                "order": "asc"
                            }
                        }
                    }
                ]
            }
        }
    }
}

```

Secondly can we create interactive graphs(plotly graphs) in the Kibana canvas like we can create in the lens visualizations dashboard?

Thirdly can we directly use queries in the SQL syntax for creating the lens visualizations?  
Thanks.

---

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [May 12, 2022, 12:53pm UTC](https://discuss.elastic.co/t/elastic-search-queries-working-for-search-endpoint-are-not-working-for-query-dsl-filter-in-kibana/304569/2 "2022-05-12T12:53:22Z")

</div>

Hi @Noman_Saleem !!

Look this:

> [@Kibana dashboard DSL aggregations problem](https://discuss.elastic.co/t/kibana-dashboard-dsl-aggregations-problem/278014/2):
>
> You can't use aggregations in a filter - filter only operate on a per-document basis. Can you explain which kind of visualization you want to build? Maybe there's another way to achieve your goal.

---

<div class="post-metadata">

### Author: ![Noman\_Saleem](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/noman_saleem/32/105422_2.png) [@Noman\_Saleem](https://discuss.elastic.co/u/Noman_Saleem)
#### Post date: [May 16, 2022, 5:33am UTC](https://discuss.elastic.co/t/elastic-search-queries-working-for-search-endpoint-are-not-working-for-query-dsl-filter-in-kibana/304569/3 "2022-05-16T05:33:40Z")

</div>

@flash1293 can you help regarding this? Thanks

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [May 16, 2022, 6:01am UTC](https://discuss.elastic.co/t/elastic-search-queries-working-for-search-endpoint-are-not-working-for-query-dsl-filter-in-kibana/304569/4 "2022-05-16T06:01:13Z")

</div>

Welcome to our community! 😃 Please don't ping people that aren't already part of your topic.

> [@Noman\_Saleem](#):
>
> I am trying to run the query on query DSL Kibana but its not working

What do you mean by not working?

---

<div class="post-metadata">

### Author: ![Noman\_Saleem](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/noman_saleem/32/105422_2.png) [@Noman\_Saleem](https://discuss.elastic.co/u/Noman_Saleem)
#### Post date: [May 16, 2022, 8:33am UTC](https://discuss.elastic.co/t/elastic-search-queries-working-for-search-endpoint-are-not-working-for-query-dsl-filter-in-kibana/304569/5 "2022-05-16T08:33:46Z")

</div>

Thanks, and as I have seen him answering similar sort of question, and after not getting any response for few days, I pinged him.

My only questions is that, can we run Elasticsearch raw queries(that include aggregations, group by, the one given in the question above) in the kibana to create interactive visualizations(plotly based)? Though non-interactive visualizations can be created in the kibana canvas using the raw Elasticsearch queries.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 13, 2022, 8:34am UTC](https://discuss.elastic.co/t/elastic-search-queries-working-for-search-endpoint-are-not-working-for-query-dsl-filter-in-kibana/304569/6 "2022-06-13T08:34:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
