Questions tagged [sosl]

SOSL the Salesforce Object Search Language syntax. Use this tag for questions related to SOSL and handling query ouput.

57 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
314 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
1answer
878 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
0answers
46 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
0answers
896 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
1answer
419 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
0answers
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
1answer
129 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
0answers
97 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
0answers
646 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 ...
3
votes
2answers
523 views

SOSL FIND of Joe return John

I wrote a SOSL query: FIND {Joe} IN NAME FIELDS RETURNING Contact It returned me couple of records in which one of them had Mark John in the name field of the Contact. Reading the SOSL documentation ...
2
votes
0answers
64 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
0answers
29 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
0answers
94 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
1answer
266 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
0answers
675 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 \'' + ...
2
votes
0answers
43 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
0answers
217 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 ...
1
vote
0answers
86 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 "test.abc1@test.digital or test.abc@test.com" and "(123) 456-7890"(based on locale). we are using ...
1
vote
0answers
63 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
0answers
225 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
0answers
59 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
0answers
176 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
0answers
144 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
0answers
188 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
2answers
627 views

how to see Objects read permissions across profiles?

I have 13 object and i want to see for each object,how many profiles having Read permission.How can i achieve it? Please suggest. Sol-I am able to do it by creating list view in profile and filter ...
1
vote
0answers
858 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
1answer
164 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 ?
1
vote
1answer
374 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)
0
votes
0answers
31 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
0answers
68 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
1answer
150 views

How to get custom field from ProcessInstance Object

I am trying to get Approval Status and some fields via TargetObjectId. SELECT Id, TargetObjectId, TargetObject.Name From ProcessInstance Where TargetObjectId='XYZ' The above SOQL works fine but when ...
0
votes
0answers
27 views

How does SOSL match the search term with Email fields?

I want to use SOSL to search for a Contact or Lead with a certain email. I want it to be an exact match but I am not sure about how SOSL matches the email fields with the search term. Given this SOSL ...
0
votes
0answers
16 views

SOSL for phone fields or email fields but not other fields

SOSL allows you to search within PHONE FIELDS, EMAIL FIELDS, or ALL FIELDS (and a couple of others). Can a single SOSL query be run for a combination of PHONE FIELDS and EMAIL FIELDS?
0
votes
0answers
24 views

Underscore returns sosl results

I have a lightning component with an account search. When I type an account name it doesnt show but If i add an underscore to the end of the name, the search result displays. Ex: Account1: Medicaid ...
0
votes
0answers
29 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
0answers
50 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
0answers
38 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
1answer
85 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
1answer
326 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
1answer
51 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 ...
0
votes
0answers
31 views

What are the ways in which access to a field by query can be changed?

On a visualforce page with a controller, users could previously search on a custom contact field via SOSL. A few weeks ago, something changed and users get no results back in the search as if they ...
0
votes
1answer
52 views

Search in All Fields plus topics for feeditems

I currently have an SOSL query [FIND :finalSearchText IN ALL FIELDS RETURNING FeedItem(Id, Title WHERE Type = 'QuestionPost') LIMIT 10]; This works great for searching the feed item title and body. ...
0
votes
1answer
139 views

Search for related records?

I have a context aware (hasRecordId) Lightning component that can be dropped on an undetermined custom object record page. I need the component to grab the recordId, then search for that recordId ...
0
votes
1answer
127 views

How to use SOSL to query cross object

I have the following method that I'm using SOSL to search against the Product2 object: public PageReference searchProducts() { try { List<List<Product2>> searchResults = [FIND ...
0
votes
0answers
125 views

Apex SOQL/SOSL Parser

Is there an Apex-based DML, SOQL and SOSL parser? I see the only way this could happen is during the time of deployment, I can use DeployDetails to get the list of SOQLs. Any pointers on how I can ...
0
votes
1answer
128 views

SOSL not retrieving correct set of records

I need your inputs on the below issue: Query - FIND {1000} IN ALL FIELDS RETURNING Product2(Id,ProductCode,Universal_Picture_Code__c,Name,Country_Code__c,SAP_Sales_Org__c WHERE SAP_Sales_Org__c IN (...
0
votes
1answer
398 views

Dynamic sosl query not returning all events with search term in their subject

I seem to have an odd issue where for certain text phrases being searched with sosl, not all events being queried with the sosl search are returned that should be. For example: when FIND (meeting*) ...
0
votes
0answers
249 views

Possible to obtain Contacts and Leads with their child relationships in one query/search?

I would like to obtain all contacts and leads that match an email address but also include their related child objects (e.g. activity histories) all in one query or one search. I can't figure out a ...
0
votes
0answers
322 views

Unable to Query the Deleted Records

I am able to see the deleted records in the Recycle Bin. But when we try to query the deleted records using the QueryAll/IsDeleted/AllRows keywords the query is not returning the records. However, ...
0
votes
0answers
45 views

Sort Articles by CaseAssociationCount issues SOSL

Seems like Salesforce wont allow me to sort articles by caseassociation count as the parent. Any ideas how I can accomplish this? SOSL FIND {*searchTerms*} RETURNING KnowledgeArticleVersion (...