code: public Query setFacets(List<String> facets) {
      JSONArray obj = new JSONArray();
      for (String facet : facets) {
        obj.put(facet);
      }
      this.facets = obj.toString();
      return this;
    }
docs: List of object attributes that you want to use for faceting. <br/>
  Only attributes that have been added in **attributesForFaceting** index
  setting can be used in this parameter. You can also use `*` to perform
  faceting on all attributes specified in **attributesForFaceting**.