Skip to content

Commit feefa53

Browse files
author
DoSun
committed
fix(indexer): simplify embedding null check query
Remove redundant empty string and empty array checks for embedding column. Only NULL check is needed since embedding is stored as a binary/vector type, not a string.
1 parent a45b325 commit feefa53

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server/internal/services/indexer_service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (s *IndexerService) IndexAll(ctx context.Context) error {
3333
var items []models.CapabilityItem
3434

3535
// Find items without embeddings
36-
result := s.db.Where("embedding IS NULL OR embedding = '' OR embedding = '[]'").
36+
result := s.db.Where("embedding IS NULL").
3737
Where("status = ?", "active").
3838
Find(&items)
3939

@@ -142,7 +142,7 @@ func (s *IndexerService) GetIndexStats(ctx context.Context) (*IndexStats, error)
142142

143143
// Count indexed items
144144
result = s.db.Model(&models.CapabilityItem{}).
145-
Where("embedding IS NOT NULL AND embedding != '' AND embedding != '[]'").
145+
Where("embedding IS NOT NULL").
146146
Count(&stats.IndexedItems)
147147
if result.Error != nil {
148148
return nil, result.Error

0 commit comments

Comments
 (0)