code: public JSONObject search(Query params, RequestOptions requestOptions) throws AlgoliaException {
      String paramsString = params.getQueryString();
      JSONObject body = new JSONObject();
      try {
        body.put("params", paramsString);
      } catch (JSONException e) {
        throw new RuntimeException(e);
      }
      return client.postRequest("/1/indexes/" + encodedIndexName + "/query", body.toString(), false, true, requestOptions);
    }
docs: Search inside the index
  
  @param the            query to search
  @param requestOptions Options to pass to this request