From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8F8E02020A for ; Mon, 4 Jan 2016 01:03:56 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/4] view: label "relevance" in threaded search view Date: Mon, 4 Jan 2016 01:03:52 +0000 Message-Id: <20160104010352.26568-5-e@80x24.org> In-Reply-To: <20160104010352.26568-1-e@80x24.org> References: <20160104010352.26568-1-e@80x24.org> List-Id: The threaded search view is somewhat alien to new users, so ensure we label the word "relevance" for them. --- lib/PublicInbox/SearchView.pm | 2 ++ lib/PublicInbox/View.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 5d4f4fe..b3ddcb5 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -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) = @_; diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index fac0fcb..4fc8ffc 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -140,8 +140,8 @@ sub index_entry { } $rv .= " parent"; } - 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 .= " [threaded" . -- EW