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

SOSL query for non-ASCII Unicode characters like âäá returns nothing

Hi everyone,


I am a bit stumped to find myself unable to query Non-ASCII unicode characters using SOSL.


For example, take a word containing a German Umlaut like Äpfel and put it into the name or some other textfield you are querying.


How does one have to construct the SOSL query so that it actually returns something?


Researching for information on how to do this did not yield any helpful clues. I even created a class to convert all characters to their unicode representation and stuffed that into the sosl query without luck.


After some more testing it seems to get even worse.


Not only does my SOSL query not retrieve results for words containing non-ASCII characters. If I search for a word made of pure ASCII characters that is also contained in a record which has a non-ASCII word in it, SOSL does NOT retrieve it like it does retrieve other records?!?


I have tested this by puttung a non-ascii word into either the name or any other queried field. SOSL always fails to retrieve the record.



Thanks for your feedback, Tobias.

Best Answer chosen by Admin (Salesforce Developers) 

Unbelievable but true...


It appears that there is a delay when it comes to indexing anything and it takes quite some considerable time for SOSL to actually return any search results. My problem wasn't related to Non-ASCII characters at all!


Please Salesforce, put that at the very top of the SOSL documentation!

Took me half a day to figure that out.


It might well be that this is only a prioritization issue with respect to sandboxes or dev orgs, who knows. But then, where do you test and develop this stuff? Right, in your production org ;-D


Thanks, Tobias.