@Override public SearchResult createNewElasticSearchResult(String responseBody, int statusCode, String reasonPhrase, Gson gson) { return createNewElasticSearchResult(new SearchResult(gson), responseBody, statusCode, reasonPhrase, gson); }
public MultiSearchResponse(JsonObject jsonObject) { final JsonElement error = jsonObject.get(ERROR_KEY); if(error != null) { this.isError = true; this.error = error; if (error.isJsonPrimitive()) { this.errorMessage = error.getAsString(); } else if (error.isJsonObject()){ this.errorMessage = error.getAsJsonObject().get("reason").getAsString(); } else { this.errorMessage = error.toString(); } this.searchResult = null; } else { this.isError = false; this.errorMessage = null; this.error = JsonNull.INSTANCE; this.searchResult = new SearchResult(gson); this.searchResult.setSucceeded(true); this.searchResult.setResponseCode(responseCode); this.searchResult.setJsonObject(jsonObject); this.searchResult.setJsonString(jsonObject.toString()); this.searchResult.setPathToResult("hits/hits/_source"); } } }
@Override public JestResult createNewElasticSearchResult(String responseBody, int statusCode, String reasonPhrase, Gson gson) { return createNewElasticSearchResult(new SearchResult(gson), responseBody, statusCode, reasonPhrase, gson); } };
@Override public SearchResult createNewElasticSearchResult(String responseBody, int statusCode, String reasonPhrase, ObjectMapper objectMapper) throws IOException { return createNewElasticSearchResult(new SearchResult(objectMapper), responseBody, statusCode, reasonPhrase, objectMapper); }
@Override public JestResult createNewElasticSearchResult(String responseBody, int statusCode, String reasonPhrase, Gson gson) { return createNewElasticSearchResult(new SearchResult(gson), responseBody, statusCode, reasonPhrase, gson); } };
@Override public SearchResult createNewElasticSearchResult(String responseBody, int statusCode, String reasonPhrase, Gson gson) { return createNewElasticSearchResult(new SearchResult(gson), responseBody, statusCode, reasonPhrase, gson); }
public MultiSearchResponse(JsonObject jsonObject) { final JsonElement error = jsonObject.get(ERROR_KEY); if(error != null) { this.isError = true; this.error = error; if (error.isJsonPrimitive()) { this.errorMessage = error.getAsString(); } else if (error.isJsonObject()){ this.errorMessage = error.getAsJsonObject().get("reason").getAsString(); } else { this.errorMessage = error.toString(); } this.searchResult = null; } else { this.isError = false; this.errorMessage = null; this.error = JsonNull.INSTANCE; this.searchResult = new SearchResult(gson); this.searchResult.setSucceeded(true); this.searchResult.setResponseCode(responseCode); this.searchResult.setJsonObject(jsonObject); this.searchResult.setJsonString(jsonObject.toString()); this.searchResult.setPathToResult("hits/hits/_source"); } } }
public MultiSearchResponse(JsonNode jsonObject) { final JsonNode error = jsonObject.get(ERROR_KEY); if (error != null) { this.isError = true; this.error = error; this.errorMessage = error.path("reason").asText(); this.searchResult = null; } else { this.isError = false; this.errorMessage = null; this.error = MissingNode.getInstance(); this.searchResult = new SearchResult(objectMapper); this.searchResult.setSucceeded(true); this.searchResult.setResponseCode(responseCode); this.searchResult.setJsonObject(jsonObject); this.searchResult.setJsonString(jsonObject.toString()); this.searchResult.setPathToResult("hits/hits/_source"); } } }
highlightMap.put("field", highlightList); SearchResult.Hit<Map, Void> hit1 = new SearchResult(gson).new Hit(HashMap.class, element, HashMap.class, null, highlightMap, null, setInvalidSearchResultIndexName ? INVALID_VALUE : TAG_SEARCH_INDEX_NAME, TAG_SEARCH_INDEX_NAME, "type", 1.0); SearchResult.Hit<Map, Void> hit2 = new SearchResult(gson).new Hit(HashMap.class, element, HashMap.class, null, highlightMap, null, BUSINESS_OBJECT_DEFINITION_SEARCH_INDEX_NAME, BUSINESS_OBJECT_DEFINITION_SEARCH_INDEX_NAME, "type", 2.0); searchHitList.add(hit1);