Questions tagged [sosl]
SOSL the Salesforce Object Search Language syntax. Use this tag for questions related to SOSL and handling query ouput.
68
questions with no upvoted or accepted answers
4
votes
1
answer
397
views
Salesforce search engine vs SOSL
Below is my SOSL query -
FIND {searchString}
IN ALL FIELDS
RETURNING Account(Id,Account_Number__c, RecordType.Name,Name LIMIT 16)
1) When I put searchString = '42430' in sosl query
Query 1:
...
4
votes
1
answer
1k
views
SOSL Query against Custom setting object
I am experiencing some inconsistent behavior. On one org - I'm doing a SOSL (Search Query) against a custom setting and it works fine. But on a different org - I get entity type My_Custom_Setting__c ...
3
votes
0
answers
427
views
Bind Variables and Inconsistent Results in SOSL
I have some Apex code that does a SOSL query. If it uses bind variables, some users don't get results. If I build the query with string concatenation, then the results are consistent across users.
...
3
votes
0
answers
71
views
How to make existing custom setting searchable?
I have one custom setting in our org which is not searchable, as verified by confirming that searchable = FALSE when viewing the object info via Workbench. Dozens of other custom settings in our org ...
3
votes
0
answers
1k
views
Salesforce limitation - SOSL search not returning records through keyword exists in the records
In our org there are more than 5 Millon CaseComment record exists. User will navigate from Account record and opens a page upon a button click. User enters the keyword and it should search on the ...
3
votes
1
answer
626
views
sosl exception on searching with one character
On doing a sosl search with just one character search parameter, I am getting an exception. To overcome this i have used custom error message in the catch block.However I am unable to cover the catch ...
3
votes
0
answers
1k
views
regEx + search capability in sfdc platform
Looking for suggestions on accomplishing search + regEx in sfdc, to search cases which have occurrence of the phrase 'PROVIDED BY:' in case history and get the case number where this phrase was found ...
3
votes
1
answer
136
views
how to add a value from a text box to SOSL querry dynamically?
I have written an sosl querry.
for(List<SObject> obj:[FIND **'jose'** IN ALL FIELDS RETURNING Lead(id,name,Company,Phone,Street,City,State,PostalCode,Country,Owner.id WHERE (Owner.id=:UserInfo....
3
votes
0
answers
111
views
SOSL unusual behaviour
I have faced and have been facing issues using the SOSL query or I may say SOSL query confuses me every time with its result/output.
i have encountered situations when the SOSL search query doesn't ...
3
votes
0
answers
741
views
How can I access Record Tags and/or Content tags via Apex & SOQL & SOSL
I have a requirement to produce a unified search across Salesforce records using tags and documents in Content. Both records and Content items may have received the same tag from a user and my ...
2
votes
0
answers
250
views
SOSL - binding a list of IDs to an IN clause
SOSL is returning different results when using a bind variable. For example, the following code snippet returns fewer results when a bind variable is used and returns more results when the bind ...
2
votes
0
answers
96
views
SOSL Wildcart Search Returning Multiple Objects Excludes Results
I am running a SOSL with a query similar to the one below:
FIND {joh* OR smith*} IN ALL FIELDS RETURNING
Account(Firstname,Lastname WHERE Firstname LIKE 'joh%' AND Lastname LIKE 'smith%'),
Contact(...
2
votes
0
answers
156
views
Searching ContentDocument with SOSL 'Name Fields' appears to return documents with the search string in the content
It looks like when I issue a SOSL statement against NAME FIELDS in ContentDocument, I get documents that have the search string in the content as well.
I really need it to just search the name fields,...
2
votes
1
answer
290
views
Inline edit - record not updating [only last record updating]
whenever i used to edit these records by inline edit function - only the last records getting updated, rest of the records not updating.
visualforce code:
<apex:page sidebar="false" ...
2
votes
0
answers
48
views
Search in related objects fields
Is there a way to make a single SOSL query to search in fields of related objects?
For example: "find all tasks related to accounts are named X*".
2
votes
0
answers
277
views
GROUP BY Clause in SOSL (FIND instead of SELECT)
I am looking for the equivalent of the GROUP BY statement but then for a FIND query.
I want to do a search on all fields of ContentVersion by a keyword and I want it to return a list of all values in ...
2
votes
1
answer
512
views
combine two SearchGroups in SOSL search
Can I combine two SearchGroup in one SOSL query? I want to search both in Name Fields and in Phone fields.
Something like
FIND {78*} IN (NAME , PHONE) FIELDS RETURNING Contact(id,name,phone)
1
vote
0
answers
66
views
SOSL Problem - Unexpected Results
I'm doing a parameterized search, but unfortunately I'm getting strange results.
I've added a long text field that, using a flow, is populated with the contents of a group of important fields: Project ...
1
vote
0
answers
163
views
Does filtering in lightning-record-picker support SOSL?
I am using the lightning-record-picker component and I am querying an object which has its 'Name' field encrypted. This means that I'm returning a 'the like operator is not supported on an encrypted ...
1
vote
0
answers
431
views
Dynamic SOSL with multiple search terms not returning records with email or phone number
I am facing couple of challenges with Dynamic SOSL.
Records are available with "[email protected] or [email protected]" and "(123) 456-7890"(based on locale).
we are using ...
1
vote
0
answers
272
views
SOQL query with 'LIKE not giving expected results
In my org, I've set up some custom metadata on which I have all text fields which I am querying.
On my query without anything in the where condition
SELECT Label,Fields__c,Labels__c,Scheme__c from ...
1
vote
0
answers
290
views
SOSL Filter on Community Topics
Back in 2014 @pchittum had mentioned in the Discussion Forums that he hoped that maybe some day we might be able to filter by topics using SOSL:
My wish is that some day in the future you can just ...
1
vote
0
answers
63
views
Too may query rows:50001
There are more than 40,000 records in my production database. Whenever I Search using these queries I get this error:
Too may query rows:50001
SOSL query:
String searchQuery = 'FIND \' '+...
1
vote
0
answers
204
views
Return category group with salesforce knowledge articles
I' writing one sosl query, where I'm facing problem while returning category group.
FIND {tourism} RETURNING KnowledgeArticleVersion
(Id, Title WHERE PublishStatus='draft')
WITH DATA CATEGORY ...
1
vote
0
answers
249
views
How to select the first record from multiple records from SOSL query
I am using SOSL query:
List<List<Account>> acclist = [FIND :newstring IN ALL FIELDS RETURNING Account(id,Name,FirstName,LastName,Territory_vod__c,NPI_vod__c where RecordType.Name='...
1
vote
0
answers
888
views
SOSL with multiple conditions not working
I have a SOSL search Query
String suppliedSearchText1 = 'account';
Set<String> setselectedObjects = new Set<String>{'Account','contact'};
String SearchQuery = 'FIND \'' + ...
1
vote
0
answers
195
views
accessing related lookup in SOQL query
Hi I am writing a SOQL query. I use Fuse IT to check my SOQL queries. So the Query is:
Select Id,Name,Material__r.APS_Account__r.FirstName, Material__r.APS_Account__r.LastName from Material_Order
...
1
vote
0
answers
1k
views
Access email subject and email body data in global search
I just noticed that in global search results, data mentioned in email body or email subject is not accessible for search results (SOSL) due to salesforce search limitations.
Ref: https://help....
1
vote
1
answer
189
views
how to find a word in url column in a given object
I am looking for SOQL/SOSL to find records in object having a URL column with some filter(text in column( on URL column, tries like and sosl, both doesn't work. Any help ?
0
votes
0
answers
35
views
How SOSL filtering works?
I thought Salesforce SOSL engine searches for records in the following order:
Search full database by the keywords
Apply additional filters from WHERE clause
Apply other filters (sharing settings, ...
0
votes
1
answer
60
views
SOSL query on ContentVersion not returning consistent results for all users
I need to search for keywords in some files in Salesforce. I am using the following SOSL query for the same:
FIND {search_term} IN ALL FIELDS RETURNING ContentVersion(ContentDocumentId, FileExtension, ...
0
votes
0
answers
53
views
can I create SOQL or SOSL command to get content of a report?
I know nothing about SF. I want to get content - preferably as .csv - or a report that someone created for me. I do not have SF account. I have access to an integration account that I managed to ...
0
votes
0
answers
27
views
What does SOSL's "Update Tracking" actually update?
The SOSL Documenation's Update an Article’s Keyword Tracking with SOSL page states:
Track keywords that are used in Salesforce Knowledge article searches with the UPDATE TRACKING optional clause on a ...
0
votes
0
answers
137
views
Performing Fuzzy search by using multiple keywords, on a specific long text area field which has keywords, hashtags on a custom object
I have a requirement to perform fuzzy search on a specific long text area field on a custom object and return the results, where long text area field can have some keywords, hashtags or quantity of ...
0
votes
0
answers
56
views
SOSL Returning incorrect result
We have one Unit Object and it has Description Text Field 255 char.
Unit Object has 50 records with '48" Test Description' As a value in description__c field.
Now We have SOSL Query as below,
...
0
votes
0
answers
62
views
SOSL Trailhead Challenge Issue
I'm new to salesforce but learing a bunch.
I'm working on the SOSL challenge. My code is returning the correct data (I think) but I still fail the challenge. Any guidance would be super appreciated.
...
0
votes
1
answer
144
views
Run SOSL without any search term
I have read the documentation for SOSL and have a usecase which is not explicitly mentioned anywhere.
I can not use SOQL as it takes over 15 seconds. We have some non-index fields and wild cards ...
0
votes
0
answers
52
views
SOSL email search is unable to locate a record in Salesforce immediately after the record has been saved (AWS and Salesforce)
I am using 2 platforms to do Extract , Transform, Load (ETL):
Salesforce (SF)
AWS
I need to ingest taxonomy CSV files based on specific campaigns - called
MVIs - into Salesforce. There are ...
0
votes
0
answers
68
views
'includes' search behavior on SOSL
Reading about 'includes' filter on SOSL I have a question:
What happens if I do: ...MyCustomField__c includes ('valueA,valueB') ?
What i know:.
If I do: ...MyCustomField__c includes ('valueA;valueB') ...
0
votes
0
answers
227
views
Is there a way to fetch the query plan for or insights about any specific SOSL execution?
Is there an alternate way to fetch the query plan of a SOSL execution (other than thru Developer Console > Query Editor)? My objective is to get some insights about any specific SOSL execution (...
0
votes
1
answer
475
views
I want to add no of count of task on lead
There are 2 fields in the lead object ,total_count__c is for count the total no of task on the lead and in the No_of_Call_Count__c i want only those task whose subject contains 'Call' in the subject ...
0
votes
0
answers
264
views
What should be used to search a string across multiple fields of a single object? SOQL or SOSL
I want to search records for a particular object based on filter string that can match multiple fields on that object. This can be achieved via both SOQL and SOSL:
SOQL : using like operator, applying ...
0
votes
0
answers
178
views
Need help in putting not equal to field in SOSL in Salesforce
I have created the below SOSL for my Apex class as per the req to return the queried valued
from the data base , but i am not able to put the not equal to operator in below SOSL,
i have tried the ...
0
votes
0
answers
189
views
SOSL does not find gmail domain in emails for Site Guest User
When running a SOSL query as the Site Guest User in an Experience Site, I am unable to retrieve any results if I return more than one object at a time while the search query is 'gmail.com'
As an ...
0
votes
0
answers
71
views
Mysterious SOSL results for Product2: adding term increases number of results
I am running SOSL queries on the Product2 table and I am getting results that I don't understand. Our Product2 table contains about 17,000 items, most of them tyres. A typical product name is "...
0
votes
0
answers
95
views
Getting Error while querying Account list -sosl -salesforce
I am getting error while querying Account & cusst obj Customer ,Below is my error and query.
Error :"Line: 9, Column: 29
Incompatible types since an instance of List<SObject> is never ...
0
votes
0
answers
259
views
Lookup text field is returned as object in SOSL query
this query is run on the Contact object. I need to get the name of the Account which is assigned to current contact.
the query works with simple SOQL:
SELECT Account.Name FROM Contact LIMIT 1
Output ...
0
votes
1
answer
215
views
SOSL return failing manage package
SOSL running fine on lower instances with no namespace getting failed in manage package.Although the SOSL EXECUTE returns rows but final output always remains 0. Working fine on unmanage.
searchQuery ...
0
votes
1
answer
514
views
How to use dynamic filters in SOSL queries
I have this below 2 SOSL queries. One which is simple one and 2nd is dynamic.
I am passing the below data to this method. The 1st SOSL is returning the data, but the dyanamic SOSL is returning NULL.
...
0
votes
1
answer
73
views
Replacing SOQL By SOSL- facing issue
So, I've parent object and approx 17-18 child object(most connected via Look ups relationship). Data goes into child object based on some conditions. Not all child objects are required to be filled at ...