Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix log message when unable to find a reference id for a document
Browse files Browse the repository at this point in the history
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 <[email protected]>
peternied committed Dec 9, 2024
1 parent fc62f57 commit a71f2a5
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit a71f2a5

Please sign in to comment.