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
5
votes
1answer
61 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 ...
0
votes
2answers
20 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 ...
0
votes
1answer
39 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 ...
9
votes
1answer
117 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, ...
2
votes
1answer
54 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
55 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
46 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
20 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
79 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
55 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
35 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 ...
0
votes
3answers
91 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 ...
3
votes
3answers
80 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
1answer
45 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
33 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
41 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 ...
2
votes
0answers
57 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 ...
0
votes
2answers
52 views

Does SOSL works when probabilistic encryption is enabled

Does Salesforce SOSL works after enabling probabilistic encryption is enabled on the search field ?
4
votes
1answer
88 views

Does SOSL wildcard (*) work with space characters

I am currently trying to implement a sosl search query, so I can filter out non-letter characters for searching inside the salesforce database. Everything works as expected, however when I encounter a ...
0
votes
1answer
30 views

“Invalid USING clause” error when using list view in SOSL

I am trying to implement SOSL list view search and this is sort of follow up question. I am trying this query in from Apex and getting error in title: System.debug( Search.find('FIND \'foo\' ...
0
votes
1answer
21 views

Error “Failed to get metadata of listview foo_baz for entity Account. ” when trying to search list view

I am trying to use 'search in list views' SOSL feature, but receiving the error mentioned in title. The query in itself is: FIND {fook} IN ALL FIELDS RETURNING Account(Id, Name USING LISTVIEW=...
1
vote
1answer
39 views

Can we use distance in a SOSL query?

Can we use distance field on a SOSL? Below query returns an error FIND {CA} IN ALL FIELDS RETURNING Contact (id, CMFSH__Resume_Id__c, name,email,phone,mailingstreet,mailingCity,mailingState,...
1
vote
1answer
60 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
1answer
25 views

Retrieve Ids of different SObjects using SOSL

I have the following apex: Schema.SObjectField field = doesNotMatter(); String fieldName = field+''; //fieldName now holds "NameOfTheField" Schema.DescribeFieldResult fieldResult = field.getDescribe()...
3
votes
3answers
1k views

SOQL Like Query?

I am trying to make a query that will search for accounts with a name similar or exactly matching a field value. So for example I have "Sales-Force" in the field. There is an account called "...
0
votes
1answer
33 views

SOSL for self lookup fields

Region__c is the self lookup on Agent__c. One region have many agents. When searchString = region name, it displays only one record. I want to display all Agents in that region. How to achieve this? ...
0
votes
1answer
61 views

SOSL on lookup fields

String query = 'FIND \'*' + searchString + '*\' IN ALL FIELDS RETURNING Ticket__C (Region__r.name, Manager__c, Manager__r.name, Name, Notes__c), user(id,Name)'; I am searching with user name and ...
-1
votes
1answer
140 views

Picklist related Query in salesforce

I Have a Picklist Field Like (Orderstatus__c) Field, Values are (A, B, C, D, E, F) This Picklist Field, when i am querying the Orderstatus__c Filed Those values will be displaying like Un order (B, E, ...
0
votes
1answer
94 views

SOSL and returned fields

In SOQL, if you don't specify the returned fields and then try to query them, you get an error. Is it the same in SOSL? List<List<sObject>> values = [FIND 'acme' IN ALL FIELDS RETURNING ...
3
votes
1answer
24 views

SOSL on Permission Sets error when no ID is included

I am testing SOSL's on Permission Sets for something I am building and noticed that if I don't include the ID in the fields to request, the search fails: An unexpected error occurred. Please ...
0
votes
1answer
122 views

Why do SOSL works after enabling Deterministic Encryption?

I have enabled Deterministic Encryption for my org, encrypted field Account.Name and created new Account 'MyAccount'. So, in my classes or in Developer Console I can search this account only by full ...
0
votes
1answer
27 views

How to get Two articles in One list using salesforce query

Hi every one I have a two articles: Offer__kav and Offer_order__kav. How to Query This Two Objects Related All Fields. For Ex: I tried : List<List<SObject>> search_results = [FIND 'SFDC'...
3
votes
2answers
120 views

SOSL: How to programmatically work out what field a search string is found in

As part of our continuing GDPR improvement, I've been tasked to easily find all records which reference an email address, telephone number or name, entered by a user as a text string. Then we want to ...
0
votes
1answer
70 views

How to Import/Query the 'EntityHistory' Object Data Through Data Loader in salesforce

i have some records/data, i mention in Excel File is in below, and i need How to Query the Records from "EntityHistory" Object... please Help me i will try my developer Edition.
1
vote
1answer
50 views

Combining result sets from SOSL query

When I query SOSL with multiple RETURNING objects, the result comes as a list of lists, each for a different sObjectType, each sorted by default by the "relevance" of each record in the result set. ...
0
votes
1answer
152 views

SOSL Query Returning Only Empty Lists / No Results

I'm trying to use SOSL to locate Account, Contact, Lead, and Site__c records by Id using a dynamic string of matching ids obtained from Destination__c records. However, I'm not returning any records ...
0
votes
1answer
47 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
2answers
285 views

dynamic SObjectType.getDescribe().isAccessible()?

I have a Lightning component with a search bar that uses Apex to search Cases, and another that searches Opportunities. For example: @AuraEnabled public static List<Case> searchCases(String ...
0
votes
1answer
272 views

How to search the Phone Field Records From All Objects using SOSL Query

i need to fetch the Phone Information from all Objects.. How i can get the Records... i tried this Below way .. but this is not Coorect... Why means for Example in my Organisation having 200 Objects ...
0
votes
0answers
19 views

Is this possible to get full text search results to find “FDD MatureApp” record using SOSL by search term “App” [duplicate]

To reproduce the problem, on a brand new fresh organization I have created two records insert new List<Account>{ new Account(Name = 'FDD App'), new Account(Name = 'FDD MatureApp') }; ...
0
votes
1answer
77 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 ...
3
votes
1answer
363 views

How to filter SOSL Query results effectively

We have a SOSL query that is searching multiple custom objects. The desired result is one search result pane that shows results from the multiple tables in one list. Because multiple custom objects ...
-1
votes
1answer
78 views

Without passing search term how to do query using sosl

I have run this sosl Query in editor,It gives zero records FIND {Doc*} IN ALL FIELDS RETURNING Document__c ( Revision__c,name,Release_Date__c,Part__c,Part__r.name,PartValueSOSL__c,PlatformSOSL__c,...
2
votes
1answer
54 views

SOSL having discrepant results than SOQL for same operation

We are performing SOQL and SOSL operation to find particular value on an object. Please find below code: String searchCustomerMobileNo = '9999999999'; Double mobileNo = Double.valueOf(...
2
votes
0answers
421 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 ...
0
votes
3answers
371 views

Fetching Test data while executing SOSL query from Test class

My Visualforce page is calling Controller methods using apex:actionFunction and are not being executed while I am implementing the test class. Also in my test class I have test contact records which ...
0
votes
1answer
159 views

What is the purpose of wildcards (asterisks) before and after SOSL Query?

I can't understand the purpose of putting asterisks before and after the SOSL query below. Is it to cover searches for the wildcards just Jsmith when the user searches smith or smithj when the user ...
1
vote
1answer
317 views

Performing a relationship query in a SOSL query?

I have found myself in a bit of a problem... I am grabbing events and their attachments based on certain filter criteria so there is no problem getting attachments in SOQL. The problem comes with the ...
1
vote
2answers
128 views

SOSL for External Object

I have configured a Salesforce Connect relationship to an external data source using a custom Apex adapter. I am trying to configure one of the external objects to allow search. I have selected the "...