From 2be2b31d6067de83d421cc4de491bf08e49aeaf5 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 11 Jul 2018 16:28:55 +1200 Subject: [PATCH] templates/query: Fix repeated terms in freq info We were ending up with an entry for each prefix searched by default. Merge these and sum their frequencies. Reported by Alistair Buxton on #xapian-discuss. --- xapian-applications/omega/templates/query | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xapian-applications/omega/templates/query b/xapian-applications/omega/templates/query index e2f689889..118e1d7fe 100644 --- a/xapian-applications/omega/templates/query +++ b/xapian-applications/omega/templates/query @@ -83,7 +83,7 @@ $if{$not{$msizeexact}, }
-$list{$map{$queryterms,$list{$html{$unique{$unstem{$_}}},,/,}: $nice{$freq{$_}}},Term frequencies: ,$. ,} +$if{$map{$queryterms,$set{U,$unstem{$_}}$set{F_$opt{U},$add{$opt{F_$opt{U}},$freq{$_}}}},$list{$unique{$map{$queryterms,$set{U,$unstem{$_}}$list{$html{$unique{$opt{U}}},,/,}: $nice{$opt{F_$opt{U}}}}},Term frequencies: ,$. ,}}
Search took $time seconds $if{$opt{clicklog},$set{queryid,$hash{md5,$transform{s/^\s+|\s+$$//g,\1,$query}}}} -- 2.11.4.GIT