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
4k views

SOSL Statement Example

Can someone please explain what the following query does..? List<List<sObject>> results = [FIND '4155557000' IN Phone FIELDS RETURNING Contact(Id, Phone, FirstName, LastName), Lead(...
6
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> ...
0
votes
1answer
20 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 ...
3
votes
1answer
605 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 ...
0
votes
2answers
456 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
39 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 ...
2
votes
1answer
230 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
2answers
475 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 ...
2
votes
3answers
1k views

API Names of all Objects to Excel

Requirement: How can i Extract API names of all object in One shot into an external file format such as Excel. I have 300 objects and I need API names of all of them. Please suggest.
0
votes
3answers
598 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
0answers
43 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
24 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 ...
3
votes
1answer
96 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 ...
0
votes
2answers
73 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&...
2
votes
1answer
79 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 ...
0
votes
1answer
785 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' ......
1
vote
0answers
43 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
30 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
33 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>> ...
3
votes
2answers
309 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 ...
1
vote
2answers
688 views

Can we do soql or sosl query on Salesforce Labels

how to query salesforce Labels using SOQL OR SOSL in query editor.
5
votes
1answer
149 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 ...
-1
votes
1answer
52 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>> ...
0
votes
0answers
12 views

SOSL distance function is not giving result with encrypted mailing field of contact?

I am using encrypted mailing field for distance search in Apex code and queryEditor, but its not working with encrypted mailing address. Below is my query: SELECT id, DISTANCE( MailingAddress, ...
1
vote
1answer
189 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
559 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 ...
1
vote
1answer
41 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
22 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, ...
13
votes
1answer
8k views

Why does SOSL return a List of a List of sObjects in Apex?

When I use SOSL in Apex (search.query();) the return type is List<List<sObject>>, but I've never run across a case in which there is more than one list returned. For example, this: ...
0
votes
1answer
36 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 ...
2
votes
1answer
96 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 ...
0
votes
1answer
2k 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. ...
1
vote
1answer
95 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
84 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
98 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
104 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
174 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
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 -...
2
votes
1answer
117 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
55 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
52 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
38 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
511 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 ...
4
votes
1answer
74 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
102 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.
1
vote
1answer
889 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
1answer
194 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
331 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. ...

1
2 3 4 5 6