function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pigginsbpigginsb 

SOSL Escaping Reserved Characters

I am trying to perform a SOSL search with the search term, '333-4444-55555', and for some reason it will not return any rows.

 

I am escaping the reserved characters, described in the reference guide...http://www.salesforce.com/us/developer/docs/soql_sosl/salesforce_soql_sosl.pdf

 

Rows will return if I search for '333-4444*', or for '333-*', or even for '333-4444*55555'.

 

But no rows return if the second dash is included in the term.

 

Please let me know if you can help with this.

 

Thanks!

DSI Delivery SFA DevDSI Delivery SFA Dev
Hi,

I'm having de same issue when trying to perform a SOSL query with multiple search terms by address(postal code and city) fields, in APEX.
Did anyone succeed?

The SOSL query before invoking Search.query() method, looks like this:
FIND { "1111\-11*" AND "lisboa*" } IN ALL FIELDS RETURNING Account(Name, BillingPostalCode, BillingCity)

Thanks!
hfadaphfadap
Hi 

If in Apex, try this:
FIND '1111\-11* AND lisboa*' IN ALL FIELDS RETURNING Account(Name, BillingPostalCode, BillingCity)

In the Force.com API:
FIND {1111\-11* AND lisboa*} IN ALL FIELDS RETURNING Account(Name, BillingPostalCode, BillingCity)