-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
A query like select day,count(*) from index where x = query('FreeBSD') group by day limit 200
generates an Elasticsearch query like this:
{
"from" : 0,
"size" : 200,
"query" : {
"bool" : {
"must" : {
"query_string" : {
"query" : "FreeBSD"
}
}
}
},
"_source" : {
"includes" : [ "day", "COUNT" ],
"excludes" : [ ]
},
"fields" : "day",
"aggregations" : {
"day" : {
"terms" : {
"field" : "day",
"size" : 200
},
"aggregations" : {
"COUNT(*)" : {
"value_count" : {
"field" : "_index"
}
}
}
}
}
}
Testing shows that the first top-level "size": 200
is unnecessary and results in much slower queries. It should probably be set to "size": 0
since the hits
aren't needed anyways when doing aggregations.
Metadata
Metadata
Assignees
Labels
No labels