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.

Filter by
Sorted by
Tagged with
1
vote
1answer
36 views

Using SOSL with wildcards in apex

I have a contact with name Test Contact in the Org. I run the SOSL like below in Query Editor and able to get results of contacts containing Test in their name: Find {*Test*} IN ALL FIELDS RETURNING ...
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> ...
1
vote
1answer
36 views

SOSL using POST REST /parameterizedSearch API

I got the "/services/data/v46.0/parameterizedSearch" POST API working for a complex SOSL search I want to perform. I am referring to the Salesforce documentation here: https://developer.salesforce....
1
vote
1answer
24 views

Not able to search fields using SOSL for Case module

I am trying to fire a SOSL query in Apex to find phone number exits in Case module. Below is the example of one of the cases that I am trying to search. I am using following query to search the ...
1
vote
2answers
38 views

Search with accent and return with/without accent

I was wondering if there is a way for me to search for a non-accented value in SOQL and the results would bring me words with and without accent. Example: I searched for "helló" and the result ...
0
votes
1answer
482 views

SOSL not work correctly?

Has anyone meet the problem that the SOSL query result does not as the expectation? One of our customer met the problem that the search result is much less than what it should be, than I ran the ...
0
votes
2answers
501 views

What is the data type returned by the following SOSL search

While preparing for DEV450 I got below question in one of the sample test What is the data type returned by the following SOSL search? [FIND 'Acme*' IN NAME FIELDS RETURNING Account, Opportunity]; ...
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 ...
2
votes
1answer
63 views

Variable in SOSL Query

In SOSL can I add a variable to the fields? As: FIND {Clinica} IN Name Fields RETURNING Account(VARIABLE HERE) Thanks
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 ...
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
1answer
30 views

SOSL issue- Ranking of results set

We're using SOSL to search Account and Contact objects and facing an issue. Records are returned in a variable of type List<List<sobject>> say searchList I'm using this variable(...
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
1answer
170 views

SOSL not returning all expected results

I'm trying to SOSL search a custom object we have, by a phone number field but the results are not working as I'd expect. The issue seems to be around missing characters at the start of the search ...
0
votes
1answer
1k views

Writing basic SOSL query

I am doing the Write SOSL Queries Trailhead module. I am getting an error. Challenge Not yet complete... here's what's wrong: The Lead and Contact records with the last name 'Smith' were not found. ...
4
votes
1answer
57 views

SOSL Doesn't find data with wildcards

I'm working on a query to find some duplicate records by name. I take the name and replace anything thats not a letter with a wildcard. I wind up with a query that looks like this: FIND {Name*Name*} ...
1
vote
1answer
64 views

How to get list of all sobject records modified today in the system?

I need a list of all sobject records that got modified today. this is not just for one object but for all objects in the system. Is there a simpler way to do this?
1
vote
0answers
28 views

How to get list of all sobject records modified today in the system? [duplicate]

I need a list of all sobject records that got modified today. this is not just for one object but for all objects in the system. Is there a simpler way to do this? Please reply.
0
votes
1answer
238 views

System Permissions Assigned to Permission Set

Is there a SOQL/SOSL to export/FETCH only the System Permissions from a Specific Permission Set in Salesforce.
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. ...
-2
votes
2answers
167 views

How to create very generic dynamic SOSL query [closed]

I have this below method which i want to make it more generic which can be used for any object and pass any filter to SOSL query according to object passed(build dynamic) . From lightning component i ...
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 ...
5
votes
1answer
82 views

Is there a reliable way to know which SObjects are supported by a SOSL search?

Having some trouble as an ISV with dynamic SOSL. I have a search box that searches all records. When building the SOSL query, I only add objects that have the IsSearchable flag set to true on the ...
9
votes
1answer
146 views

SOSL query having issues with quotes (in the record(s) that should be returned, not the query string)

Tried to do some due diligence before asking this one. I have read the SOSL documentation, and have done some cursory searching here on SFSE. Scenario I have an integration with an external system, ...
0
votes
2answers
71 views

SOSL not returning record in test

I have EditorModalController.searchDoctors that returns a list of contacts. public class EditorModalController { @AuraEnabled public static List<Contact> searchDoctors(String ...
3
votes
2answers
995 views

SOSL on Lookup Fields not working.

How do we write SOSL that searches lookup fields. Example My query looks this. "FIND \'Mark\' in all fields returning Account(Id, Name, User.Name)" Here it doesn't search User with keyword Mark. ...
0
votes
1answer
53 views

Most efficient way to get all child records for a specific record

I have an account record that I want to get every single possible child record - ideally as a list of IDs. Currently I am doing the following: for(Opportunity opp : [SELECT ID From Opportunity ...
1
vote
2answers
804 views

How to search Knowledge Articles bypassing Guest user permissions in Napili Community?

Background: We have a public page on Napili community where guest user can type the search term into the custom search component and see the results. If we use the OOB Napili search functionality, ...
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
3answers
2k views

SOQL: Ability to search on multiple fields using Like

I'm looking a way to provide a user ability to search on multiple fields like the user can search on Name or Description or Make or Model etc.. I have the following code in my apex public ...
2
votes
1answer
247 views

Does containsIgnoreCase() and contains() string methods , work with a Rich Text Field?

I am working on use case, where i need to search a keyword on a custom Object containing three Rich Text Fields. I am using the string method containsIgnoreCase(). But even if the field contains the ...
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
3answers
60 views

type error with apex

with a list of "mails", I want to search for emails in my salesforce object "PrincipalProduit__c", but I find errors in my variable "var and searchList" public List<String> getValo(){ List<...
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
1answer
84 views

SOSL No Result in Apex (Not Test Mode)

I want to query matching Accounts based NRIC Passport No AND Service Agent looking up to custom object Agent__c with a set of Ids (for bulkification) and i'm using: FIND '999999' IN ALL FIELDS ...
0
votes
1answer
334 views

SOSL Multiple Search Words

Trying to search multiple terms in SOSL in APEX. I tried this singular, of course works: [FIND 'searchOne' IN ALL FIELDS RETURNING ACCOUNT] But these don't work: [FIND 'searchOne' OR 'searchTwo' ......
2
votes
1answer
84 views

DescribeFieldResult.isQueryable returns true but field is not supported

I'm writing a component to search all possible objects a lookup can point to and am running into an issue. The code below returns a list of strings to be used in a SOSL query. I've hard-coded Task and ...
3
votes
3answers
96 views

Array notation for List<List<Sobject>>

In an attempt to be as byte pinching as possible(personal goal), I have a question some time on Google has not been able to answer. I did look at some Java documentation to try and resolve the issue ...
0
votes
3answers
279 views

How to write SOSL IN query

I've following SOQL query - SELECT Id, Name, Email, Account.Id, Account.Name FROM Contact WHERE Email in :emails Here emails is a comma separated list of email ids. Can I write the same query in ...
0
votes
1answer
57 views

Global Search in salesforce

I was searching for record by passing some value in global search but I am getting different result whenever add '0' prefix to it. When i am searching for '012345' i got three record but when i search ...
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 ...
3
votes
0answers
90 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 ...
4
votes
1answer
635 views

Why are no results returned when performing a SOSL query on ContentNote in a Test Method?

Following the example laid out in Adding SOSL Queries to Unit Tests, I created a test method that inserts a ContentNote record, sets the results using Test.setFixedSearchResults(), and then performs a ...
0
votes
2answers
96 views

Does SOSL works when probabilistic encryption is enabled

Does Salesforce SOSL works after enabling probabilistic encryption is enabled on the search field ?
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", ...