0

I want to use SOSL to search for a Contact or Lead with a certain email. I want it to be an exact match but I am not sure about how SOSL matches the email fields with the search term. Given this SOSL query:

FIND :emailAddress
IN EMAIL FIELDS
RETURNING
 Contact(Id, Email),
 Lead(Id, Email)

From what I noticed, even though the search term is supposed to be an exact match, this is not always the case. For example:

  • jack would match: jackSmith@email.com, paul@jack.com, jack@email.com, Smith.jack@email.com
  • jack@ would match the same records
  • jack@email would match nothing even though there are records with email jack@email.com
  • jack@email.com would match only jack@email.com and not Smith.jack@email.com

How does this work?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.