def facets(params = nil)
      raise RemovedFeature, 'removed in elasticsearch 2.0' if Runtime.version >= '2.0'
      if params
        chain { criteria.update_facets params }
      else
        _response['facets'] || {}
      end
    end
def facets(params = nil)
      raise RemovedFeature, 'removed in elasticsearch 2.0' if Runtime.version >= '2.0'
      if params
        chain { criteria.update_facets params }
      else
        _response['facets'] || {}
      end
    end
Adds facets section to the search request.
 All the chained facets a merged and added to the
 search request

 @example
   UsersIndex.facets(tags: {terms: {field: 'tags'}}).facets(ages: {terms: {field: 'age'}})
     # => {body: {
            query: {...},
            facets: {tags: {terms: {field: 'tags'}}, ages: {terms: {field: 'age'}}}
          }}

 If called parameterless - returns result facets from ES performing request.
 Returns empty hash if no facets was requested or resulted.