]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: label "relevance" in threaded search view
authorEric Wong <e@80x24.org>
Mon, 4 Jan 2016 01:01:41 +0000 (01:01 +0000)
committerEric Wong <e@80x24.org>
Mon, 4 Jan 2016 01:01:41 +0000 (01:01 +0000)
The threaded search view is somewhat alien to new users,
so ensure we label the word "relevance" for them.

lib/PublicInbox/SearchView.pm
lib/PublicInbox/View.pm

index 5d4f4fe249c38157318d8fc50b0cbc132ad567ac..b3ddcb54cac4d14793b90afebfafdff98e9a1b0f 100644 (file)
@@ -56,6 +56,8 @@ sub sres_top_html {
        [$code, ['Content-Type'=>'text/html; charset=UTF-8'], [$res]];
 }
 
+# display non-threaded search results similar to what users expect from
+# regular WWW search engines:
 sub dump_mset {
        my ($res, $mset) = @_;
 
index fac0fcb161cc9ec95cd2512ac0ec2219c61d633d..4fc8ffc38da8592657561ea89b55880548f4a982 100644 (file)
@@ -140,8 +140,8 @@ sub index_entry {
                }
                $rv .= " <a\nhref=\"$parent_anchor\">parent</a>";
        }
-       if (my $pct = $state->{pct}) {
-               $rv .= " [$pct->{$mid_raw}%]";
+       if (my $pct = $state->{pct}) { # used by SearchView.pm
+               $rv .= " [relevance $pct->{$mid_raw}%]";
        } elsif ($srch) {
                if ($ctx->{flat}) {
                        $rv .= " [<a\nhref=\"${path}$href/t/#u\">threaded</a>" .