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
3
votes
1answer
29 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
184 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
29 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
222 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
108 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
62 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
200 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
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
2answers
519 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
425 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
20 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
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 ...
3
votes
1answer
507 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
168 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
68 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
632 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
550 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
220 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
541 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
187 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 "...
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,...
1
vote
2answers
421 views

SOSL search in master details objects

I have two object A__c(s1__c) and B__c(s2__c) and relationship among them is Master-details. I have to make a SOSL search in field of both(s1__c and s2__c). Find {searchText} Returning A__c(s1__c), ...
2
votes
2answers
154 views

SOSL Query returns an Error

I am trying to display related contacts on the record detail page based on the current Contact record id. For the related contacts, my SOSL as follows: String searchQuery = 'FIND \'' + firstName + ' ...
3
votes
1answer
93 views

SOSL - URL Encode necessary with Asterisks?

My chief question: does Salesforce's SOSL/Parameterized search accept * wildcard searches? Related q: Does URL encoding a url with search string parameters including asterisk and + characters ...
1
vote
0answers
131 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 ...
0
votes
0answers
93 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 ...
1
vote
1answer
201 views

Invalid bind expression type of String for column of type Decimal. Auto type casting?

I ran into this exception while trying to make some dynamic SOQL queries(also SOSL but haven't gotten to test those yet). Basically I'm trying to build a query string and add a dynamic value as one ...
0
votes
1answer
63 views

: execution of BeforeUpdate caused by: System.QueryException: Non-selective query against large object type (more than 200000 rows)

I was wondering if someone can help me with the following queries. I'm getting the following errors when I try to run my trigger. The Records I'm returning is only 28 records: : execution of ...
0
votes
1answer
114 views

System.UnexpectedException: Search Term exceeded max length: in apex class

I am getting the below error: System.UnexpectedException: Search Term exceeded max length Using this query: String sosl = 'FIND {' + String.join(new List<String>(SAPs),' OR ') + '} IN ALL ...
2
votes
1answer
500 views

Test Method for @HttpPost RestResource is not returning expected results

I have been looking all over the boards and found some useful posts regarding testing rest services, but even after spending the last 2 hours trying to implement many of those ideas, I still am stuck ...
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. ...
0
votes
2answers
23 views

I have 1M records -some records are from data loader and there is no picklist restriction

I have 1M records -some records are from data loader and there is no picklist restriction I want to see uniuqe values for account object with that perticular values.
2
votes
2answers
399 views

Question about setFixedSearchResults() Apex Tests with SOSL

The documentation on preparing tests for code with SOQL queries includes the comment "Additionally, the test method can call Test.setFixedSearchResults multiple times to define different result sets ...
1
vote
1answer
809 views

Using encrypted fields in SOSL query gives in 0 results

My org has Classic encryption and I have a encrypted field in contact object. I am trying to use that field in SOSL. FIND {123456789} IN ALL FIELDS RETURNING CONTACT(NAME) This is returning 0 ...
-2
votes
1answer
305 views

What is the execution time spent in the database for an DML or SOQL or SOSL?

Is it possible to find the execution time for a DML or SOQL or SOSL? What are the factors on which the execution time of these queries depend?
-1
votes
2answers
259 views

Does Salesforce publish their SOQL and SOSL grammar?

Does Salesforce publish their SOQL and SOSL grammar? Do we have any link to download? I need to use ANTLR for creating parser on the SOQL and SOSL grammar. Please can any one help on this.
5
votes
1answer
260 views

Sosl on FeedItems with network id

I am trying to query for FeedItems that belong to a specific community as follows: FIND {searchTerm} RETURNING FeedItem(Id,Title,Body) WITH NETWORK IN ('SomeID') However, I noticed that the query ...
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 \' '+...
0
votes
1answer
332 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 ...
1
vote
1answer
2k views

SOSL query field limitations

Someone asked me why a SOQL query for a product value on the Case object returned all the records with the product name queried while a SOSL search on the same returned only 1 record. Example using ...
1
vote
1answer
393 views

Can we do soql or sosl query on Salesforce Labels

how to query salesforce Labels using SOQL OR SOSL in query editor.
-3
votes
1answer
234 views

SOSL not able to fetch records when called from Apex, even though database having matching records

I have been facing a unique kind of issue since the last 2 days, I am using SOSL Query in my Apex. It is working on a partial basis, i.e, returning records perfectly in some cases, while not returning ...
0
votes
1answer
79 views

expecting a right parentheses SOSL

I am creating a dynamic SOSL which finally executed as below when I print in debug: FIND 'gar,ont2' RETURNING Contact ( Name, FirstName, LastName WHERE (Preferred_First_Name__c like '%gar%' OR ...
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*) ...
1
vote
1answer
102 views

Testing SOSL - setFixedSearchResults: Is there a possibility to mock other fields than Id?

I need to test the following SOSL query: FIND {"Example"} IN ALL Fields RETURNING ExampleObject(Field_One__c, Field_Two__c WHERE Condition_Field != 'value') My code behaves differently depending on ...
0
votes
2answers
259 views

Is this SOSL search equivalent to the SOQL query?

Due to the need to apply Platform Encryption to the email address field on Contact and the fact that you can't use encrypted fields in a SOQL WHERE clause, I'm trying to convert the query to a SOSL ...
0
votes
1answer
37 views

Sosl Returning Clause required

Can anyone explain what is meant by this statement: The RETURNING clause is optional via the API, but required via Apex code. SOSL Reference All I see from the docs is that the returning clause is ...
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" ...
1
vote
2answers
264 views

Not getting a value in SOQL

I am not getting a value in SOQL, while in system debug I am getting only this output : cid:ali record:() Code: MVImportBatch__c record = [select Id from MVImportBatch__c limit 1]; string cid ...