4

I am trying to do an accent insensitive query in SOQL. Using something like :

SELECT * FROM table_name WHERE column_name LIKE '%andre%'

I would like the database to return me a list of rows which column_name are presented with and without accent. column_name solutions such as Alexandre, Andre or André. I already checked SalesForce link : http://www.salesforce.com/us/developer/docs/soql_sosl/index_Left.htm#CSHID=sforce_api_calls_sosl_where.htm|StartTopic=Content%2Fsforce_api_calls_sosl_where.htm|SkinName=webhelp discussing about the different comparison operators but without success.

Has anyone already been confronted to that type of problem in SOQL, and found an answer to it ?

2

Quoting @sfdcfox from Accents in SOQL queries (my emphasis):

You'd have to perform a SOSL instead: SOQL doesn't support accent translation, according to any docs I've ever seen. However, SOSL uses a full-text search index that is accent agnostic.

There are further notes in that thread that you should use the unaccented characters to drive the search as this will return accented results. However, if you search for a specific accented character the unaccented results will not appear.

Assuming the underlying text search uses Oracle Text and with some trial and error you may be able to determine which combination of BASE_LETTER, ALTERNATE_SPELLING, and OVERRIDE_BASE_LETTER attributes are being used.

  • Thank you for the answer Daniel. And sorry for the late reply. I will look into that. – Kin Jan 10 '15 at 1:20
0

Well, I don't think either SOQL or SOSL can give you the results for the phonetic match. You have to use the phonetic algorithm to match the word. May be you need to make an API call to the service who provides the sound/phonetic matching. There is article on the same should it help you.

https://arungaikwad.wordpress.com/tag/salesforce-and-soundex/

  • Hi Shaileh. Thank you, but that sound quiet complex and does not involve accent matching. I am looking for an accent agnostic pattern matching type of solution which in the best case would involve SOQL. Plus from my understanding of the link, this will not work when using a foreign name. – Kin Jan 5 '15 at 14:19

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.