diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/SearchIndexApp.java b/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/SearchIndexApp.java index c0aa0686b5c8..d534e1300254 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/SearchIndexApp.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/SearchIndexApp.java @@ -218,8 +218,8 @@ private void entitiesReIndex(JobExecutionContext jobExecutionContext) { try { resultList = paginatedEntitiesSource.readNext(null); if (!resultList.getData().isEmpty()) { + searchIndexSink.write(entityProcessor.process(resultList, contextData), contextData); if (!resultList.getErrors().isEmpty()) { - searchIndexSink.write(entityProcessor.process(resultList, contextData), contextData); throw new SearchIndexException( new IndexingError() .withErrorSource(READER) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/PaginatedEntitiesSource.java b/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/PaginatedEntitiesSource.java index 52ff762c9eeb..60e5ce027b12 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/PaginatedEntitiesSource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/workflows/searchIndex/PaginatedEntitiesSource.java @@ -109,7 +109,8 @@ private ResultList read(String cursor) throws SearchI } else { submittedRecords = batchSize; String decodedCursor = RestUtil.decodeCursor(cursor); - this.cursor = RestUtil.encodeCursor(String.valueOf(Integer.parseInt(decodedCursor) + batchSize)); + this.cursor = + RestUtil.encodeCursor(String.valueOf(Integer.parseInt(decodedCursor) + batchSize)); updateStats(0, batchSize); } IndexingError indexingError =