about summary refs log tree commit homepage
path: root/lib/PublicInbox/CodeSearch.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-28 17:55:09 +0000
committerEric Wong <e@80x24.org>2023-11-29 02:13:27 +0000
commitd440959d8df609f3f2422d89381978116db4ad04 (patch)
tree9a07ac1d2bddac239e332c705b76d8fcc40e07f5 /lib/PublicInbox/CodeSearch.pm
parenta8e3c2ad544f9f78ebbe91bfe0dece0e2d385322 (diff)
downloadpublic-inbox-d440959d8df609f3f2422d89381978116db4ad04.tar.gz
www: load cindex join data for ->ALL, too
This ensures the /all/ extindex can have auto-associations
with coderepos just like normal inboxes do.
Diffstat (limited to 'lib/PublicInbox/CodeSearch.pm')
-rw-r--r--lib/PublicInbox/CodeSearch.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/PublicInbox/CodeSearch.pm b/lib/PublicInbox/CodeSearch.pm
index 7c0dd063..5c5774cf 100644
--- a/lib/PublicInbox/CodeSearch.pm
+++ b/lib/PublicInbox/CodeSearch.pm
@@ -339,6 +339,15 @@ EOM
                 my $s = $git->{ibx_score};
                 @$s = sort { $b->[0] <=> $a->[0] } @$s if $s;
         }
+        my $ALL = $pi_cfg->ALL or return;
+        my @alls_gits = sort {
+                scalar @{$b->{ibx_score} // []} <=>
+                        scalar @{$a->{ibx_score} // []}
+        } values %$coderepos;
+        my $gits = $ALL->{-repo_objs} //= [];
+        push @$gits, @alls_gits;
+        my $cr_score = $ALL->{-cr_score} //= {};
+        $cr_score->{$_->{nick}} //= scalar(@{$_->{ibx_score}//[]}) for @$gits;
 }
 
 sub repos_sorted {