]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Search.pm
www_stream: add trailing slash for help and color links
[public-inbox.git] / lib / PublicInbox / Search.pm
index 8e4cce33f5f6eb267d480da59e3f6b59a9d01fe5..c7d52dafc3f4f9e37491aea50c6ac13880ee8b62 100644 (file)
@@ -13,9 +13,9 @@ use POSIX qw(strftime);
 # values for searching, changing the numeric value breaks
 # compatibility with old indices (so don't change them it)
 use constant {
-       TS => 0, # Received: header in Unix time (IMAP INTERNALDATE)
+       TS => 0, # Received: in Unix time (IMAP INTERNALDATE, JMAP receivedAt)
        YYYYMMDD => 1, # Date: header for searching in the WWW UI
-       DT => 2, # Date: YYYYMMDDHHMMSS
+       DT => 2, # Date: YYYYMMDDHHMMSS (IMAP SENT*, JMAP sentAt)
 
        # added for public-inbox 1.6.0+
        BYTES => 3, # IMAP RFC822.SIZE
@@ -337,7 +337,7 @@ sub query_argv_to_string {
        my (undef, $git, $argv) = @_;
        my $to_parse;
        my $tmp = join(' ', map {;
-               if (s!\b(d|rt|dt):([[:print:]]+)\z!date_parse_prepare(
+               if (s!\b(d|rt|dt):(\S+)\z!date_parse_prepare(
                                                $to_parse //= [], $1, $2)!sge) {
                        $_;
                } elsif (/\s/) {
@@ -357,7 +357,7 @@ sub query_approxidate {
        my $DQ = qq<"\x{201c}\x{201d}>; # Xapian can use curly quotes
        $_[2] =~ tr/\x00/ /; # Xapian doesn't do NUL, we use it as a placeholder
        my ($terms, $phrase, $to_parse);
-       $_[2] =~ s{([^$DQ]*)([${DQ}][^\"]*[$DQ])?}{
+       $_[2] =~ s{([^$DQ]*)([$DQ][^$DQ]*[$DQ])?}{
                ($terms, $phrase) = ($1, $2);
                $terms =~ s!\b(d|rt|dt):(\S+)!
                        date_parse_prepare($to_parse //= [], $1, $2)!sge;
@@ -481,7 +481,7 @@ sub qparse_new ($) {
        $cb->($qp, $NVRP->new(DT, 'dt:'));
 
        # for IMAP, undocumented for WWW and may be split off go away
-       $cb->($qp, $NVRP->new(BYTES, 'bytes:'));
+       $cb->($qp, $NVRP->new(BYTES, 'z:'));
        $cb->($qp, $NVRP->new(TS, 'rt:'));
        $cb->($qp, $NVRP->new(UID, 'uid:'));