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
0
votes
2answers
25 views

SOQL Query to extract certain attachments fails

I want to export attachments of those Owners who belong to a certain Organisation. I tried: SELECT BodyLength FROM Attachment WHERE OwnerId.Organisation_Name__r = 'ExampleCompanyName', but got the ...
0
votes
0answers
38 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
25 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 ...
1
vote
1answer
47 views

Apex SOSL-query doesn't work

Query Result why SOSL-query is empty?
0
votes
1answer
25 views

Query involving parent and child objects in where, group by and order by clause

I have an object called SRC which has account as lookup in it. SRC content will be as shown below: SRC ID Account__c Status City__c LastModifiedOn 1 1 Yes Delhi 12-Apr 2 1 No Cochin 13-Apr 3 2 No ...
0
votes
1answer
33 views

Converted SOSL from SOQL is not working

SOQL query SELECT Id, Name FROM Opportunity WHERE College__r.Phone LIKE '%7411162213' OR College__r.OtherPhone LIKE '%7411162213' on running on developer console it gives result total ...
0
votes
0answers
21 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 ...
2
votes
1answer
32 views

Why does SOQL show there is data but SOSL returns no results?

I want to search for a list of phrases. I used SOSL to search for a string to begin with but it is returning zero results yet when I run a soql I can see there is data. Any ideas? Thanks. FIND {Animal}...
0
votes
1answer
39 views

Getting Malformed Query error when hitting SOSL using Rest Assured

I have a requirement to fetch query results of a SOSL query using REST API. Even after encoding the SOSL search I keep on getting Malformed Query error. I am so far unable to find a reason to it. This ...
0
votes
1answer
32 views

SOSL , in all fields and in any fields [closed]

I'm confused on when do i really need to use IN ANY FIELDS and in ALL Fields . Can someone clear things out for me thank you!
1
vote
2answers
71 views

History field is blank for this query, Please help :)

I am new to salesforce, please help me out with this one: I am trying the following SOQL query to retrieve the changes made to the teacher object but I am getting nothing in the history tab. I turned ...
0
votes
0answers
14 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
1answer
53 views

SOSL Query returning different results in anonymous and class

We are facing a strange error when running SOSL query in our production environment. We have a component that runs SOSL queries within a custom object, looking in all text fields When we run this SOSL ...
0
votes
1answer
25 views

Locating Email within Contact and Leads records using SOSL and LIMIT keyword

I have a question regarding a SOSL statement used with a Limit of 1 in trying to search for an email address in either contact or lead records but I only want to return the first occurrence using the ...
1
vote
1answer
120 views

What's the main differences between isQueryable() vs isSearchable()

What's the main differences between isQueryable() vs isSearchable() ? I couldn't find any reasonable information
0
votes
1answer
61 views

SOSL query ApexClass not returning result with Name Fields search group

I'm trying to SOSL search ApexClass below. FIND {MyTestClass} IN NAME FIELDS RETURNING ApexClass(Name) The Name on ApexClass is a name field. Why this SOSL query has no record returned?
0
votes
0answers
16 views

SOQL query to get files names related to account [duplicate]

I want to get the names of all related files in the Account object. Below is my query: SELECT Name, (SELECT Id from Attachments) FROM Account WHERE Id= '0014K00000C6b7pQAB' When I run the query, it ...
0
votes
0answers
18 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
1answer
28 views

setFixedSearchResults not working?

I have a test method calling setFixedSearchResults with 5 ids, and then a method performing an SOSL search. I expect my search to return 5 records. In fact, it did in my previous scratch org, test ...
1
vote
0answers
36 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 ...
0
votes
0answers
24 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
1answer
36 views

SOSL Query on Product does not search the standard Family field

I am executing the following query: FIND {LANDWAGEN} IN ALL Fields RETURNING Product2(ProductCode ORDER BY ProductCode) I know there are products with this value in the Family field, but 0 rows are ...
0
votes
1answer
357 views

SOSL syntax to search from all objects

I need to create a custom search on Lightning Component where I should be able to search the text from all the objects through SOSL. I followed the module on trailhead and was able to create a custom ...
0
votes
0answers
47 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
29 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
2answers
138 views

SOSL Query and Update

I am practicing SOSL queries. I tried to find the matching records of given Email ID across all objects and update it to new Email ID using SOSL query. My Code: public class Soslxmpl{ public List&...
3
votes
1answer
201 views

Can we have sub query in SOSL?

I have to retrieve parent and related child records in a query . The way we do it in SOQL is SELECT Name, Description__c, (SELECT Description__c, Name FROM Child__r) FROM Parent Similarly I have ...
1
vote
0answers
54 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 ...
3
votes
0answers
39 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 ...
2
votes
0answers
27 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(...
0
votes
1answer
36 views

SOSL Query: Getting different number of records while searching with 1234* and abcd1234*

I have a community page. It has a search box and a list view to display the search result. Below is the Query I'm building: (It will search in 15M total records) List<List<sObject>> ...
-1
votes
1answer
82 views

Why the SOSL doesn't get what it needs?

SOSL String searchword ='Red'; String searchStr1 = '*'+searchword+'*'; String searchQuery = 'FIND \'' + searchStr1 + '\' IN ALL FIELDS RETURNING Product2(Id,Name)'; List<List<sObject>> ...
1
vote
1answer
849 views

SOSL query searching in multiple fields

I want to search in multiple fields using SOSL. I know that it allows to search in all fields using below syntax- FIND {"Smith"} IN ALL FIELDS RETURNING contact (name), lead (name) And also works ...
1
vote
1answer
103 views

Does Global Search in lightning truly not have the ability to actually search all records?

I know this is old news, but I wanted to make sure I understood the limitations of Global Search before I go ranting on the IdeaXchange, because it still boggles my mind that you cannot actually ...
0
votes
1answer
49 views

Filter Object Queries Based On Profile Name

So, as the title says, I would like to find all the records of an object that have been created by OR are only visible by a certain profile. Here is a query I have tried SELECT Id, Subject, ...
0
votes
1answer
66 views

How Do I Find What Field the SOSL Find value is in?

For example I am searching for a value of a0I1300002XwIQj. My SOSL returns 33 accounts, but I am trying to find what field on the account that the value is in. How would I go about that? Our org has a ...
3
votes
1answer
130 views

SOSL Query not returning wildcard results

I am developing a search function for a community that has to implmenent a SOSL Query against multiple objects in order to return the accurate results. The issue I've run into is that when querying ...
1
vote
1answer
194 views

SOSL query getting malformed query exception

I have built up a dynamic search query using sosl The query string given below FIND {a016g00000D57xKAAR} IN ALL FIELDS RETURNING Attachment(ParentId), ContentVersion(FirstPublishLocationId), ...
1
vote
1answer
226 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 ...
1
vote
1answer
243 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
1answer
166 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
2answers
336 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 ...
2
votes
1answer
151 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
0
votes
1answer
70 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
254 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
39 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(...
3
votes
1answer
145 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
877 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
2answers
1k 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]; A -...
4
votes
1answer
120 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
2 3 4 5
7