You need to sign in to do that
Don't have an account?
Problems with SOSL
Hi everyone,
I am facing a strange issue with an SOSL in my apex code.
My SOSL searches against a custom object called Keyword.
One of my keyword record has the value " Ivan systems,Mobile Systems,Solution Provider" in one of its long text area(32000) field.
String keywordTerm =null;
keywordTerm = 'Mobile*';
Set<Id> validAccountsSetNonFed = new Set<Id>();
validAccountsSetNonFed.add('0013000000AP7Hs');
List<List<SObject>> searchList=[FIND :keywordTerm in all fields returning Keyword__c(Account__c where Account__c IN :validAccountsSetNonFed limit 200)];
List<Keyword__c> accountsWithKeyWord = searchList[0];
System.debug('##########################:'+accountsWithKeyWord);
This SOSL returns 0 rows if i give the keywordTerm as 'Mobile*'.
But when i give it as 'Mobile* and *ivan*' it fetches me the record.
What could be the reason that this code snippet is behaving in this way.?
Thanks & Regards,
Vineetha
Hi Vinny,
Try this,
keywordTerm = 'Mobile%;
just keywordTerm = 'Mobile' should work.
Use this