Хорошо, решено.
URL url =SearchServiceHelper.getSearchURL( URLEncoder.encode("searchstring", java.nio.charset.StandardCharsets.UTF_8.toString()));
HttpsURLConnection connection = SearchServiceHelper.getHttpURLConnection(url, "GET", "KEY");
JsonReader jsonReader = Json.createReader(connection.getInputStream());
JsonObject jsonObject = jsonReader.readObject();
JsonArray jsonArray = jsonObject.getJsonArray("value");
jsonReader.close();
System.out.println(connection.getResponseMessage());
System.out.println(connection.getResponseCode());
System.out.println(url);
JsonArray jsonResult = jsonArray;
List<Structure> docList = jsonToDocument(jsonResult);
-------------------
Where :
private static final String _searchURL = "https://%s.search.windows.net/indexes/%s/docs?api-version=%s&search=%s&searchMode=all";
public static URL getSearchURL( String query) throws MalformedURLException
{
Formatter strFormatter = new Formatter();
strFormatter.format(_searchURL, "searchservicenameonly", "index", "api-version", query);
String url = strFormatter.out().toString();
strFormatter.close();
return new URL(url);
}
---------------------------------------------------------------------
public static HttpsURLConnection getHttpURLConnection(URL url, String method, String apiKey) throws IOException
{
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.setRequestMethod(method);
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("api-key", apiKey);
return connection;
}
Вы должны создать структуру для сохранения данных, которые возвращает поиск.