code: public JSONObject deleteBy(Query query, RequestOptions requestOptions) throws AlgoliaException {
      String paramsString = query.getQueryString();
      JSONObject body = new JSONObject();
      try {
        body.put("params", paramsString);
      } catch (JSONException e) {
        throw new RuntimeException(e);
      }
      return client.postRequest("/1/indexes/" + encodedIndexName + "/deleteByQuery", body.toString(), false, false, requestOptions);
    }
docs: Delete all objects matching a query
  
  @param query          the query string
  @param requestOptions Options to pass to this request