From 114d8b2417490d215d016ac4cda5b6a95eb2bd33 Mon Sep 17 00:00:00 2001 From: Srijan Saket Date: Wed, 5 Feb 2025 09:28:25 -0800 Subject: [PATCH] Restore previous logic as language is already being set in builder.go --- index/shard_builder.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/index/shard_builder.go b/index/shard_builder.go index b261eb98..3f76cc8e 100644 --- a/index/shard_builder.go +++ b/index/shard_builder.go @@ -412,11 +412,8 @@ func (b *ShardBuilder) Add(doc Document) error { if len(doc.Content) > MaxFileSize { doc.SkipReason = fmt.Sprintf("file size %d exceeds maximum size %d", len(doc.Content), MaxFileSize) - } - - if idx := bytes.IndexByte(doc.Content, 0); idx >= 0 { + } else if idx := bytes.IndexByte(doc.Content, 0); idx >= 0 { doc.SkipReason = fmt.Sprintf("binary content at byte offset %d", idx) - doc.Language = "binary" } if doc.SkipReason != "" {