+ Start a Discussion
Aladdin USAladdin US 

What is SOSL query’s are, and what they returns, and how it return

ajay Duggi(Heptarc)ajay Duggi(Heptarc)

Dear Aladdin,

What is SOSL : Salesforce Object Search Language (SOSL) is a Salesforce search language that is used to perform text searches in records. 
What they returns : SOSL returns records whose field values you want to search in query.
How it return : When will execute the query and it will go to related Sobject and display to user.

I hope it will give good understand which I meant to say.
Reference :

Cadbury USCadbury US
   Thanks but didnot understand how it return.

Murali MattaMurali Matta
Hi Aladdin,

1.SOSL stand for “Salesforce Search Language” and it is used to search the field in all the object or in particular object.
2. SOSL search in four field (id,name,email,phone).
3.The result of SOSL is a list of lists of sObjects “List<List<sObject>>”.
4.The returned result contains the list of sObjects in the same order as order mentioned in SOSL query.

Where can use SOSL:
SOSL is used if we don’t know in which object the data is present.
We can retrieve multiple objects and field values efficiently when the objects may or may not be related to each other.
We can search only on those fields whose data type is text, phone and Email.
We can use in classes but not in Triggers.
We cannot perform DML operation on search result.

Hope below links can help you.

Let me know if you have any confusion.

Kindly mark this as solved if the reply was helpful.