]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: drop longer subject: prefix for search
authorEric Wong <e@80x24.org>
Fri, 9 Sep 2016 00:01:23 +0000 (00:01 +0000)
committerEric Wong <e@80x24.org>
Fri, 9 Sep 2016 00:02:17 +0000 (00:02 +0000)
We only document the "s:" anyways.  While the long name is more
descriptive, the ambiguity makes agnostic caching (by Varnish or
similar) slightly harder and longer URLs are more likely to be
accidentally truncated when shared.

lib/PublicInbox/Search.pm
t/search.t

index aec459b3a5ce50ccb4c3c399f76496bddd45f871..3b25b6625005d646dcd422ba444bfc1ae6295947 100644 (file)
@@ -58,7 +58,6 @@ my %bool_pfx_external = (
 );
 
 my %prob_prefix = (
-       subject => 'S',
        s => 'S', # for mairix compatibility
        m => 'Q', # 'mid' is exact, 'm' can do partial
        f => 'A', # for mairix compatibility
index bb0861a10acd46c71d1eeb021bc599068991db99..7abaf8321530c90c054ce58c1d687036ff4b31c2 100644 (file)
@@ -123,19 +123,19 @@ sub filter_mids {
                is($res->{total}, 0, "path variant `$p' does not match");
        }
 
-       $res = $ro->query('subject:(Hello world)');
+       $res = $ro->query('s:(Hello world)');
        @res = filter_mids($res);
-       is_deeply(\@res, \@exp, 'got expected results for subject:() match');
+       is_deeply(\@res, \@exp, 'got expected results for s:() match');
 
-       $res = $ro->query('subject:"Hello world"');
+       $res = $ro->query('s:"Hello world"');
        @res = filter_mids($res);
-       is_deeply(\@res, \@exp, 'got expected results for subject:"" match');
+       is_deeply(\@res, \@exp, 'got expected results for s:"" match');
 
-       $res = $ro->query('subject:"Hello world"', {limit => 1});
+       $res = $ro->query('s:"Hello world"', {limit => 1});
        is(scalar @{$res->{msgs}}, 1, "limit works");
        my $first = $res->{msgs}->[0];
 
-       $res = $ro->query('subject:"Hello world"', {offset => 1});
+       $res = $ro->query('s:"Hello world"', {offset => 1});
        is(scalar @{$res->{msgs}}, 1, "offset works");
        my $second = $res->{msgs}->[0];
 
@@ -181,7 +181,7 @@ sub filter_mids {
        $rw_commit->();
        $ro->reopen;
 
-       # Subject:
+       # subject
        my $res = $ro->query('ghost');
        my @exp = sort qw(ghost-message@s ghost-reply@s);
        my @res = filter_mids($res);