All aggregations and sorting are configured via the visual builder in the UI. The search bar can accept query DSL for the purposes of filtering the documents, but only the query/filter part of the DSL.
Check out this thread for such an example: Where to add a missing filter in this Kibana search