Aggregation quires in Query DSL of add filters in Discover

Hi team,

I'm trying to write a query in Query DSL of Add filters in Discover tab.
"size": 0,
"aggs": {
"test": {
"nested": {
"path": "users"
},
"aggs": {
"users": {
"terms": {
"field": "users.username.keyword"
}
}
}
}
}

Issue : I'm getting result in Dev tools but if I execute same in Query DSL i'm getting this error " Discover: Internal Server Error ".

Could you please help on this.

Thanks,
Satish.

Welcome!

Anything in elasticsearch logs?

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.

Thanks!

I'm trying to write a query in Query DSL of Add filters in Discover tab.
"size": 0,
"aggs": {
"consumer_orgs": {
"terms": {
"field": "subscribers.consumerorgname.keyword"
}}}
Issue : I'm getting result in Dev tools but if I execute same in Query DSL i'm getting this error " Discover: Internal Server Error ".

Can we write aggregation queries in Query DSL in Discover?

Probably not but I moved your question to #kibana.

Again please read this about how to format.

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