A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
5
votes
1answer
1k views

SOSL query returns only 250 records even if there are more than 2000+ records present

I have two queries List<sobject> soslRecords1 = Search.query('FIND {I need help res*} in all fields returning Incident__c (id) where ID IN:rec_ids')[0]; List<sobject> ...
4
votes
1answer
267 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: ...
3
votes
0answers
91 views

How do I get SOSL WITH HIGHLIGHT in Apex?

Is it possible to get the highlight field from a SOSL search within apex? For example: List<List<Contact>> results = [ FIND {text} IN ALL FIELDS RETURNING Contact(Id, Name) WITH ...
3
votes
1answer
250 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 ...
3
votes
0answers
483 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
1answer
241 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
119 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
91 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
594 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
1answer
48 views

SOSL query on Lightning Knowledge Articles returns only 250 records even if there are more than 2000+ matching records

Below query returns 250 records FIND {*test*} IN ALL FIELDS RETURNING Knowledge__kav(Id, Title WHERE PublishStatus='online' AND Language= 'en_US') Below query returns 2000 records FIND {*test*} IN ...
2
votes
0answers
635 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 ...
2
votes
0answers
46 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
216 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
456 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
42 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*".
1
vote
1answer
122 views

Contacts with MiddleName values and queries

As per this previous question, I believe that Salesforce (still!) has a bug in querying Contact instances when middle names are enabled and set. If I have a Contact with FirstName "Mohammed", ...
1
vote
0answers
134 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
57 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
158 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
115 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
1answer
252 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
0answers
162 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
1answer
434 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
150 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
609 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
525 views

Getting total records in SOSL query

Sorry if this is a basic query but I need to get total number of records while getting response of SOSL query. I had to use SOSL query as SOQL could not search large text fields or custom fields. So ...
1
vote
1answer
149 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
1answer
20 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
45 views

Help with the SOQL query on multiple objects

Need SOQL or SOSL query to return the Accounts Name having at least a Partner, and/or Contact and/or an Activity attached to it. So far i am able to get the account name where owner ID is '...
0
votes
0answers
24 views

Error when storing SOSL Result into other list “Final Exception : Collection Is Ready Only”

I have written a SOSL query to search on a Custom Object and a Standard Object. When I am getting the results from it, then I am trying to store the value of fields into a set, to do a SOQL query ...
0
votes
1answer
95 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
59 views

Sidebar fields in the 'IN Searchroup' in SOSL?

I have read in the developer guide that I can also search for Sidebar fields but I was wondering what exactly does he mean by Sidebar fields ? I would be greatful if someone gave me some examples. ...
0
votes
1answer
38 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
25 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
0answers
118 views

How to pass id of selected record from sobject list to the pdf page

I have a Visualforce page with a page block table which contains multiple rows based on the search result from sosl query.Now I need to select multiple rows using checkbox and on button click need to ...
0
votes
1answer
26 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
0answers
45 views

No FirstPublishLocationId for a File after uploading a new version

I have a custom search component that queries ContentVersion for files that are associated with a custom object. The query uses FirstPublishLocationId to check if a certain field is set at the record ...
0
votes
0answers
49 views

SOSL Returning 0 Results For Custom Setting Objects

We have been using SOSL to query a list of countries defined as a custom setting which was working fine until recently. I have also tried SOSL on other custom setting objects and getting 0 results as ...
0
votes
1answer
67 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
92 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
94 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
336 views

Lookup: Show distinct values in SOSL

I am creating a lookup on Account.Name field in Lightning. The problem is that Name field is not unique. So on searching for an account name, the lookup is displaying the same account name multiple ...
0
votes
1answer
106 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
263 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
218 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
236 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
36 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 (...
0
votes
1answer
57 views

I need to search data in account records for oerticular field

Requirement:- In account object i have one field with name approve_Profile__c. i have 1Lakh of account records. I need to check for this(approve_Profile__c) field for data. Select id,...
0
votes
1answer
104 views

How to query on Category group to find all child or subcategories. ?

I have an issue. In knowledge base i have two Category groups, One is A and other is B. Now under A i have ALL--->Subcategories. Now i want to write a query which can get me all subcategories under A....