From f74b64dbe75226b996367a6049ebd00a3e39ba49 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 7 Jan 2017 01:44:52 +0000 Subject: search: remove subject_summary Apparently it never actually got used, and the world seems fine without it, so we can drop it. While we're at it, consider removing our subject_path usage from existence, too. We are not using fancy subject-line based URLs, here. --- lib/PublicInbox/Search.pm | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'lib/PublicInbox/Search.pm') diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 86354b57..a1bae419 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -326,6 +326,7 @@ sub find_doc_ids_for_term { } # normalize subjects so they are suitable as pathnames for URLs +# XXX: consider for removal sub subject_path { my $subj = pop; $subj = subject_normalized($subj); @@ -343,32 +344,6 @@ sub subject_normalized { $subj; } -# for doc data -sub subject_summary { - my $subj = pop; - my $max = 68; - if (length($subj) > $max) { - my @subj = split(/\s+/, $subj); - $subj = ''; - my $l; - - while ($l = shift @subj) { - my $new = $subj . $l . ' '; - last if length($new) >= $max; - $subj = $new; - } - if ($subj ne '') { - my $r = scalar @subj ? ' ...' : ''; - $subj =~ s/ \z/$r/s; - } else { - # subject has one REALLY long word, and NOT spam? wtf - @subj = ($l =~ /\A(.{1,72})/); - $subj = $subj[0] . ' ...'; - } - } - $subj; -} - sub enquire { my ($self) = @_; $self->{enquire} ||= Search::Xapian::Enquire->new($self->{xdb}); -- cgit v1.2.3-24-ge0c7