I want get [email protected] by searching lei4 or gmail.com.

The first one only have token: email.
What I want is like the second one
Can we parse the email to email, asciiword and host token? any ideas will help.
I already read the tsearch2 guide, reference, etc. can't find the solution.
A simple solution would be to transform email addresses into local-part at domain-part before feeding them to the TS parser.
Since at is a stop word in english, it will be ignored.
=> select to_tsvector('english','lei4 at gmail.com');
to_tsvector
------------------------
'gmail.com':3 'lei4':1
So both lei4 and gmail.com are going to be found in this tsvector.
As a side note, [email protected] is a valid email address and the TS parser is wrong in tokenizing it into four parts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With