use of io.searchbox.core.MultiSearchResult in project graylog2-server by Graylog2.
the class ElasticsearchBackendErrorHandlingTest method deduplicateShardErrorsOnSearchTypeLevel.
@Test
public void deduplicateShardErrorsOnSearchTypeLevel() throws IOException {
final MultiSearchResult multiSearchResult = searchResultFromFixture("errorhandling/failureOnSearchTypeLevel.json");
when(jestClient.execute(any())).thenReturn(multiSearchResult);
final QueryResult queryResult = this.backend.doRun(searchJob, query, queryContext);
final Set<SearchError> errors = queryResult.errors();
assertThat(errors).isNotNull();
assertThat(errors).hasSize(1);
assertThat(errors.stream().map(SearchError::description).collect(Collectors.toList())).containsExactly("Unable to perform search query: \n\nFailed to parse query [[].");
}
use of io.searchbox.core.MultiSearchResult in project graylog2-server by Graylog2.
the class ElasticsearchBackendTestBase method resultFor.
MultiSearchResult resultFor(String result) {
final ObjectMapper objectMapper = objectMapperProvider.get();
final MultiSearchResult multiSearchResult = new MultiSearchResult(objectMapper);
multiSearchResult.setSucceeded(true);
try {
multiSearchResult.setJsonObject(objectMapper.readTree(result));
return multiSearchResult;
} catch (IOException e) {
}
return null;
}
Aggregations