function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sfdcchampionssfdcchampions 

SOSL in Apex controller

Hi Forum members,
 
I am trying to use SOSL in my Customcontroller class,please help me using that cause the concept is not much clear to me .
I am currently queing data through SOQL.that i have to upgrade to SOSL
 
I have to fetch data from a custom object say "obj__c".
 
so the code is :-
-------------------
 
String namevalue = 'Mathew' ;
String statevalue = 'GA' ;
String typevalue = 'VIP' ;
 
List<List<SObject>> searchList = [ FIND :namevalue IN NAME FIELDS RETURNING obj__c(Id,Name,Room WHERE  State__C like :statevalue   AND State__C like Type__C:typevalue )];
 
 
I am not able to understand this query completly:-
1). This query will fetch me records where the 3 condition met
2). What if i also heve to retrieve child records of this master object in a single go.
3). I have to fetch relational values also like : -  address__r.name  etc  s where to specify them
4). [ Select Id,Name,(Select Name,Date, From ChildObject__r)from obj__c ]  HOW to convert this query in SOSL
 
Please suggest and help
Thanks