My query returns a single field of every document i have. Instead of returning millions of results, how can i aggregate them and return a single bucket?
1 Answer
If your query has something like:
"_source": {field_name}
It's normal that the results only return the field "field_name" of all the documents that matched with your query.
On the other hand, you should seriously consider upgrading your ES version. At least use any of the 6.x versions or superior.
A lot of functions, calls and aggregations has been removed or added. This with the goal of improving your experience with ES. In other words, staying in older versions will be a pain in the back.
1 Comment
Leonardo
The issue with using the "_source" is that it will imply several million results, that will be paginated and fetched. If i managed to aggregate them, i can retrieve them all in a single large request, instead of several thousands small ones