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
bretondevbretondev 

SOSL Query does not return only exact match

I have an Account with Name "ATALANTE".
When I do a SOSL Query with filter "ATALANTA", the account is still returned.
It looks like SOSL does not search only exact matches.
User-added image

Can someone explain this?
I cannot find any article or documentation that explains this behavior, and I need to provide official explanation to my client.

Thank you
Best Answer chosen by bretondev
ravi soniravi soni
hy,
sosl query return data based on search but there is alternative that return only exact data.
//SOSL
FIND {Lockdown New Account 2021} IN NAME FIELDS RETURNING Account (id,Name WHERE Name = 'Lockdown New Account 2021')

you can use SOQL Query as well for achieve this requirment.
//SOQL
SELECT Id,name From Account Where Name = 'Lockdown New Account 2021'

don't forget to mark it as best answer.
Thank you


 

All Answers

ravi soniravi soni
hy,
sosl query return data based on search but there is alternative that return only exact data.
//SOSL
FIND {Lockdown New Account 2021} IN NAME FIELDS RETURNING Account (id,Name WHERE Name = 'Lockdown New Account 2021')

you can use SOQL Query as well for achieve this requirment.
//SOQL
SELECT Id,name From Account Where Name = 'Lockdown New Account 2021'

don't forget to mark it as best answer.
Thank you


 
This was selected as the best answer
Suraj Tripathi 47Suraj Tripathi 47
Hi,

Yes, you are correct in SOSl while search similar data also fetch but data come from the object which 
you mention while searching.

If you find your Solution then mark this as the best answer.

Thank you!

Regards,

Suraj Tripathi