Skip to content

Commit

Permalink
Merge branch 'delete-missing-index-entry' of lkiesow/opencast into r/…
Browse files Browse the repository at this point in the history
…16.x

Pull request opencast#6175

  Deleting events which do not exist in the search index
  • Loading branch information
gregorydlogan committed Sep 25, 2024
2 parents c459da5 + 240f8fa commit b0e0131
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,11 @@ public boolean deleteSynchronously(final String mediaPackageId) throws SearchExc
var updateRequst = new UpdateRequest(INDEX_NAME, mediaPackageId)
.doc(gson.toJson(json), XContentType.JSON);
esIndex.getClient().update(updateRequst, RequestOptions.DEFAULT);

} catch (ElasticsearchStatusException e) {
if (e.status().getStatus() != RestStatus.NOT_FOUND.getStatus()) {
throw e;
}
logger.warn("Event {} is not in the search index. Skipping deletion", mediaPackageId);
} catch (IOException e) {
throw new SearchException("Could not delete episode " + mediaPackageId + " from index", e);
}
Expand Down

0 comments on commit b0e0131

Please sign in to comment.