Can I use relationships in SOSL?
Example: Find all first names that start with 'Roc' within Position__c
FIND \'Roc*\' IN ALL FIELDS RETURNING Position__c(Id, Contact__r.FirstName WHERE Title__c = 'Paper Jammer')
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communitySOSL does not support traversing relationship query .
When you write a query as below
List<List<SObject>> searchList = [FIND :mySearchText IN ALL FIELDS
RETURNING
Account (id, name,phone, BillingStreet,BillingCity,BillingState, owner.Alias,owner.MobilePhone )];
You will notice that owner.Alias will be null but you will still get ownerId and you can use ownerId to further form queries .