use of org.graylog.shaded.elasticsearch7.org.elasticsearch.action.get.GetRequest in project vorto by eclipse.
the class ElasticSearchService method modelIndexExist.
@SuppressWarnings("unused")
private boolean modelIndexExist(ModelId modelId) {
PreConditions.notNull(modelId, "modelId must not be null.");
GetRequest getRequest = new GetRequest(VORTO_INDEX, DOC, modelId.getPrettyFormat());
getRequest.fetchSourceContext(new FetchSourceContext(false));
getRequest.storedFields("_none_");
try {
return client.exists(getRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
throw new IndexingException(String.format("Error while querying if model '%s' exist.", modelId.getPrettyFormat()), e);
}
}
Aggregations