Commit bdb2b484 authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen
Browse files

trigger remove from euler removing from index

parent 7652d978
......@@ -398,6 +398,7 @@ public class SearchServiceImpl implements SearchService {
LOG.error(format("Failed to delete %s in elasticsearch", xuri.getUri()), e);
throw new ServerErrorException(e.getMessage(), INTERNAL_SERVER_ERROR);
}
triggerRemoveFromEuler(xuri);
}
@Override
......@@ -749,6 +750,17 @@ public class SearchServiceImpl implements SearchService {
}
}
private void triggerRemoveFromEuler(XURI xuri) {
try (CloseableHttpClient httpclient = createDefault()) {
URI uri = new URI("http://euler:8080/api/authorities/"+xuri.getType()+"/"+xuri.getId()+"/index");
try (CloseableHttpResponse delResponse = httpclient.execute(new HttpDelete(uri))) {
// no-op
}
} catch (Exception e) {
LOG.error(format("Failed to remove doc %s from euler index", xuri.getUri()), e);
}
}
private Response doSearch(String query, URIBuilder searchUriBuilder) {
try {
HttpGet httpGet = new HttpGet(searchUriBuilder
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment