From a71f2a55440edf16df7439fcd127d343ccda537d Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Mon, 9 Dec 2024 19:18:22 +0000 Subject: [PATCH] Fix log message when unable to find a reference id for a document We were incorrectly reporting documents that were missing a reference id as an error message whereas this is on par with a missing source body at warning level. Updated the error message to include slightly more context for troubleshooting. Signed-off-by: Peter Nied --- .../bulkload/common/LuceneDocumentsReader.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReader.java b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReader.java index 0b3f5fbc0..2308769af 100644 --- a/RFS/src/main/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReader.java +++ b/RFS/src/main/java/org/opensearch/migrations/bulkload/common/LuceneDocumentsReader.java @@ -207,14 +207,17 @@ protected RfsLuceneDocument getDocument(IndexReader reader, int docId, boolean i } } if (id == null) { - log.atError().setMessage("Document with index {} does not have an id. Skipping") - .addArgument(docId).log(); + log.atWarn().setMessage("Document with index {}, doc id: {} does not have an referenceable id. Skipping") + .addArgument(reader.getContext().id().toString()) + .addArgument(docId) + .log(); return null; // Skip documents with missing id } if (sourceBytes == null || sourceBytes.bytes.length == 0) { log.atWarn().setMessage("Document {} doesn't have the _source field enabled") - .addArgument(id).log(); + .addArgument(id) + .log(); return null; // Skip these }