You need to sign in to do that
Don't have an account?

SOSL returns less rows than SOQL
Hi all,
I came across a problem that SOSL returns less rows than expected. SOQL returns the right number of rows.
Basically, in below snippet, I tried to get all rows which string 205640 exists in vin_person__c field.
SOSL only returns 2 rows. But SOQL return 6 rows including 2 rows in SOSL result.
What could be the problem?
Thanks,
David
I came across a problem that SOSL returns less rows than expected. SOQL returns the right number of rows.
Basically, in below snippet, I tried to get all rows which string 205640 exists in vin_person__c field.
SOSL only returns 2 rows. But SOQL return 6 rows including 2 rows in SOSL result.
What could be the problem?
list<list<sobject>> slist =[FIND '*205640*' IN all FIELDS RETURNING VIN__c (Id,Name,Program__c,VIN_Person__c,Person__c,Car__c where Program__r.Account__c='001o000000ODW6lAAH' AND Inactive__c=FALSE ) LIMIT 100]; system.debug(slist); list<vin__c> svin = [select Id,Name,Program__c,VIN_Person__c,Person__c,Car__c from vin__c where Program__r.Account__c='001o000000ODW6lAAH' AND VIN_Person__c LIKE '%205640%' AND Inactive__c=FALSE LIMIT 100]; system.debug(svin);
Thanks,
David
ie.
if name is leading with a letter, like H205640, X205640,or A205640, it is in SOSL result.
If name is leading with a number, like 8205640,3205640, it is not included in sosl result.
How to resolve this issue?