pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: valgog@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6375: tsearch does not recognize all valid emails
Date: Tue, 03 Jan 2012 18:04:23 +0000
Message-ID: <E1Ri8il-0008Ct-9p@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      6375
Logged by:          Valentine Gogichashvili
Email address:      valgog@gmail.com
PostgreSQL version: 9.1.1
Operating system:   Debian 4.4.5-8
Description:        

Hello, 

default tsearch parser does not recognize all valid email addresses and
tokenizes them as text, splitting into tokens. 

For example:

postgres=# select to_tsquery('simple', 'normal@email.com' );
     to_tsquery     
────────────────────
 'normal@email.com'
(1 row)

here it behaves ok;

postgres=# select to_tsquery('simple', '-still-normal@email.com' );
        to_tsquery        
──────────────────────────
 'still-normal@email.com'
(1 row)

here it trims '-' from the beginning of an email. This is not correct, but
will at least find that email.

postgres=# select to_tsquery('simple', '-not-normal-with-dash-@email.com'
);
                                  to_tsquery                                
  
───────────────────────────────────────────────────────────────────────────────
 'not-normal-with-dash' & 'not' & 'normal' & 'with' & 'dash' & 'email.com'
(1 row)

and this is now a real problem as it leads to finding emails that are not
the same, but are "super-sets" of that one.

Valid email characters, that are not correctly treated also are at least '+'
and '.'

With my best regards, 

-- Valentine Gogichashvili 




view thread (3+ messages)  latest in thread

Message-ID: <E1Ri8il-0008Ct-9p@wrigleys.postgresql.org>
Permalink:  ../E1Ri8il-0008Ct-9p@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1Ri8il-0008Ct-9p@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: valgog@gmail.com
  Subject: Re: BUG #6375: tsearch does not recognize all valid emails
  In-Reply-To: <E1Ri8il-0008Ct-9p@wrigleys.postgresql.org>
  References: <E1Ri8il-0008Ct-9p@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox