def aggregations(params = nil)
      @_named_aggs ||= _build_named_aggs
      @_fully_qualified_named_aggs ||= _build_fqn_aggs
      if params
        params = {params => @_named_aggs[params]} if params.is_a?(Symbol)
        params = {params => _get_fully_qualified_named_agg(params)} if params.is_a?(String) && params =~ /\A\S+#\S+\.\S+\z/
        chain { criteria.update_aggregations params }
      else
        _response['aggregations'] || {}
      end
    end
def aggregations(params = nil)
      @_named_aggs ||= _build_named_aggs
      @_fully_qualified_named_aggs ||= _build_fqn_aggs
      if params
        params = {params => @_named_aggs[params]} if params.is_a?(Symbol)
        params = {params => _get_fully_qualified_named_agg(params)} if params.is_a?(String) && params =~ /\A\S+#\S+\.\S+\z/
        chain { criteria.update_aggregations params }
      else
        _response['aggregations'] || {}
      end
    end
Sets elasticsearch `aggregations` search request param

 @example
  UsersIndex.filter{ name == 'Johny' }.aggregations(category_id: {terms: {field: 'category_ids'}})
     # => {body: {
            query: {...},
            aggregations: {
              terms: {
                field: 'category_ids'
              }
            }
          }}