To reproduce the problem, on a brand new fresh organization I have created two records
insert new List<Account>{
new Account(Name = 'FDD App'),
new Account(Name = 'FDD MatureApp')
};
Now, SOQL query select id, name from Account where name like '%app%'
returns both records
while SOSL query FIND {*app*} IN ALL FIELDS RETURNING Account (Id, Name)
returns only the first record but doesn't return the second record even if I put asterisks around the search term
Why does this happen? Is SOSL Full text search broken in Salesforce and why? Why SOSL fails to find the record with search term in it?
I am not asking about why search clause with term surrounded by asterisks doesn't return records, am I asking how do I find records like "FDD MatureApp" using SOSL. Is this possible to get full text search results to find "FDD MatureApp" record using SOSL by search term "App"?
M*App
would returnMatureApp
(but notApp
), but*App*
results in the leading*
being ignored; the index cannot find words in the middle or end of other words. It's not really a "full text" search, it's an indexed search.