Skip to content

Commit c99ce4f

Browse files
committed
Fix search total count
1 parent 9cbe13a commit c99ce4f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,6 @@ def search(
15321532
# Optional: filter to only results with images
15331533
if has_images:
15341534
all_rows = [r for r in all_rows if '![' in (r['text'] or '')]
1535-
total = len(all_rows)
15361535
rows = all_rows[offset: offset + limit]
15371536

15381537
# Group by subject
@@ -1579,6 +1578,7 @@ def search(
15791578
filter_params,
15801579
has_images=has_images,
15811580
)
1581+
total = sum(subject_counts.values())
15821582

15831583
# Cross-subject hint
15841584
cross_subjects = [s for s in subject_counts if subject_counts[s] > 0]

0 commit comments

Comments
 (0)