From b92e18171f4d5dca49771fedb0e2eae42ebf0ed9 Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Mon, 14 Jun 2021 14:02:42 +0200 Subject: [PATCH] solr query for delete --- .../openaire/directindex/scheduled/ScheduledActions.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dnet-directindex-api/src/main/java/eu/dnetlib/openaire/directindex/scheduled/ScheduledActions.java b/apps/dnet-directindex-api/src/main/java/eu/dnetlib/openaire/directindex/scheduled/ScheduledActions.java index f9511bc2..b362bd35 100644 --- a/apps/dnet-directindex-api/src/main/java/eu/dnetlib/openaire/directindex/scheduled/ScheduledActions.java +++ b/apps/dnet-directindex-api/src/main/java/eu/dnetlib/openaire/directindex/scheduled/ScheduledActions.java @@ -87,10 +87,10 @@ public class ScheduledActions { final IndexDsInfo info = isLookupClient.currentIndexDsInfo(); final SolrIndexClient solr = solrIndexClientFactory.getClient(info); - // TODO: verificare query - list.stream().map(RecordInfo::getId).map(id -> "objIdentifier=" + id).forEach(t -> { + list.stream().map(RecordInfo::getId).forEach(id -> { try { - solr.deleteByQuery(t); + final String query = String.format("objidentifier:\"%s\" OR resultdupid:\"%s\"", id, id); + solr.deleteByQuery(query); } catch (final DirectIndexApiException e) { log.error(e); }