algoliasearch/src/main/java/com/algolia/search/saas/Index.java
protected byte[] searchRaw(@Nullable Query query, @Nullable RequestOptions requestOptions) throws AlgoliaException {
        if (query == null) {
            query = new Query();
        }

        try {
            String paramsString = query.build();
            if (paramsString.length() > 0) {
                JSONObject body = new JSONObject();
                body.put("params", paramsString);
                return client.postRequestRaw("/1/indexes/" + encodedIndexName + "/query", /* urlParameters: */ null, body.toString(), true, requestOptions);
            } else {
                return client.getRequestRaw("/1/indexes/" + encodedIndexName, /* urlParameters: */ null, true, requestOptions);
            }
        } catch (JSONException e) {
            throw new RuntimeException(e); // should never happen
        }
    }
protected byte[] searchRaw(@Nullable Query query, @Nullable RequestOptions requestOptions) throws AlgoliaException {
        if (query == null) {
            query = new Query();
        }

        try {
            String paramsString = query.build();
            if (paramsString.length() > 0) {
                JSONObject body = new JSONObject();
                body.put("params", paramsString);
                return client.postRequestRaw("/1/indexes/" + encodedIndexName + "/query", /* urlParameters: */ null, body.toString(), true, requestOptions);
            } else {
                return client.getRequestRaw("/1/indexes/" + encodedIndexName, /* urlParameters: */ null, true, requestOptions);
            }
        } catch (JSONException e) {
            throw new RuntimeException(e); // should never happen
        }
    }
Searches inside the index.

@param requestOptions Request-specific options.
@return a byte array containing search results
@throws AlgoliaException