Skip to content

Commit

Permalink
Restore previous logic as language is already being set in builder.go
Browse files Browse the repository at this point in the history
  • Loading branch information
srijansk committed Feb 5, 2025
1 parent 306f34d commit 114d8b2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index/shard_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down

0 comments on commit 114d8b2

Please sign in to comment.