solr query for delete

This commit is contained in:
Michele Artini 2021-06-14 14:02:42 +02:00
parent b9b29e2b2c
commit b92e18171f
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}