diff --git a/src/main/java/org/folio/search/service/reindex/ReindexMergeRangeIndexService.java b/src/main/java/org/folio/search/service/reindex/ReindexMergeRangeIndexService.java index 1632f3465..6f2e41758 100644 --- a/src/main/java/org/folio/search/service/reindex/ReindexMergeRangeIndexService.java +++ b/src/main/java/org/folio/search/service/reindex/ReindexMergeRangeIndexService.java @@ -83,7 +83,7 @@ private List constructRecordMergeRanges(int recordsCount, List ranges = new ArrayList<>(); int pages = (int) Math.ceil((double) recordsCount / rangeSize); var query = CqlQuery.sortBy(new CqlQuery("cql.allRecords=1"), CqlQueryParam.ID); - var recordIds = inventoryService.fetchInventoryRecordIds(recordType, null, 0, rangeSize); + var recordIds = inventoryService.fetchInventoryRecordIds(recordType, query, 0, rangeSize); if (CollectionUtils.isEmpty(recordIds)) { log.warn("There are no records to create merge ranges: [recordType: {}, recordsCount: {}, tenant: {}]", recordType, recordsCount, tenantId); diff --git a/src/main/java/org/folio/search/service/reindex/jdbc/ReindexStatusRepository.java b/src/main/java/org/folio/search/service/reindex/jdbc/ReindexStatusRepository.java index 853e18d09..24b491ca3 100644 --- a/src/main/java/org/folio/search/service/reindex/jdbc/ReindexStatusRepository.java +++ b/src/main/java/org/folio/search/service/reindex/jdbc/ReindexStatusRepository.java @@ -13,6 +13,7 @@ import java.util.List; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; import org.folio.search.model.reindex.ReindexStatusEntity; import org.folio.search.model.types.ReindexEntityType; import org.folio.search.model.types.ReindexStatus; @@ -20,6 +21,7 @@ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; +@Log4j2 @Repository @RequiredArgsConstructor public class ReindexStatusRepository { @@ -73,6 +75,8 @@ public void setReindexMergeFailed(List entityTypes) { var sql = UPDATE_FOR_ENTITIES_SQL.formatted( fullTableName, "%s = ?, %s = ?".formatted(STATUS_COLUMN, END_TIME_MERGE_COLUMN)); + log.info("inTypes: {}", inTypes); + log.info("sql: {}", sql); jdbcTemplate.update(sql, ReindexStatus.MERGE_FAILED.name(), Timestamp.from(Instant.now()), inTypes); } diff --git a/src/main/resources/changelog/changes/v4.0/create-reindex-entity-tables.xml b/src/main/resources/changelog/changes/v4.0/create-reindex-entity-tables.xml index 8a0ee6bb8..0ce592753 100644 --- a/src/main/resources/changelog/changes/v4.0/create-reindex-entity-tables.xml +++ b/src/main/resources/changelog/changes/v4.0/create-reindex-entity-tables.xml @@ -246,7 +246,7 @@ - +