People who code: we want your input. Take the Survey

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
4
votes
3answers
2k views

SOSL returning maximum of 500 records

I am using SOSL to search records in Salesforce. According to document http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_sosl_limit.htm, It should return 2000 records but ...
2
votes
1answer
837 views

Bulkify SOSL query in loop

I'm trying to build a process which looks up a matching account for a lead, given a cleaned email or website. The issue I'm facing is that this could be run against 1000 or 10k leads at once and the ...
2
votes
2answers
2k views

Method does not exist, is not static, or does not return the expected search results

Hi I'm doing the challenge for SOSL Queries and here is what I have accomplished so far. public class ContactAndLeadSearch { public static List < List < SObject >> searchList(String ...
9
votes
2answers
1k views

SOSL : FIND '“com”' returning more records than FIND '“com” or “net”'

When trying to search a string using SOSL, it behaves differently for one search parameter vs two search parameters with logical operator. Search String 1 : FIND '"com"' => No of Records Returned : ...
1
vote
1answer
3k 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
votes
1answer
962 views

Result of sosl query convert to list and show in visualforce page

public List<sObject> sobjlst {get; set;} public void find() { if(searchText != null && searchText.length() > 1){ List<List<SObject>> results = [FIND :('*' + ...
0
votes
1answer
191 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 ...
1
vote
1answer
119 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
1answer
54 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
257 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
280 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 ...
0
votes
2answers
228 views

Record search with and without apostrophe

We want to get account record in Salesforce with soql or sos. e.g suppose St. Patrick's account exists. Whenever we enter St. Patricks in input text box then system needs to return above record i.e ...
0
votes
1answer
1k views

KnowledgeableUser does not support search

Using SOSL I did the following Query: FIND {name} in NAME FIELDS Returning KnowledgeableUser(ID) Console returns the following: entity type KnowledgeableUser does not support search It looks ...
5
votes
1answer
2k views

SOQL query FeedItem by community

I would like to query feed items on a specific community, but can't figure out how to do so in SOQL. For example, this query returns no results. SELECT Id,Body,NetworkScope FROM FeedItem WHERE ...
1
vote
1answer
143 views

Picklist in SOSL on an encrypted org

Can anyone tell me if a picklist field is encrypted and I use SOSL, is there a limitation that it still wont match it in a query? Im on an ecrypted org and I am doing a query: FIND {golf*} IN ALL ...
1
vote
0answers
99 views

Need help in writing SOSL query [closed]

I have three objects: ccrz__E_Order__c ccrz__E_OrderItem__c CC_Account_Address Relation between these are as below. I have this ccrz__Order__c(Master detail with ccrz__E_Order__c ) on ...
1
vote
1answer
153 views

Comparing duplicate emails between Accounts and Leads

I realize accounts and leads are not inherently related, but due to our business process we typically see a large volume of leads that have already been converted into Person Accounts being ...
1
vote
3answers
335 views

What is difference between status and body column of ApexClass?

Query 1 : SELECT id,name FROM apexclass where (status like 'active') this query is returning valid result. Query 2 : SELECT id,name FROM apexclass where (body like 'istest') is returning below error....
2
votes
1answer
278 views

SOSL Offset Changes Order for Knowledge

I am Running into something that appears to be a bug in how Salesforce SOSL queries work with knowledge. Consider this Snippet of code: String searchquery = 'FIND \'SEARCH TERM\' IN ALL FIELDS ...
3
votes
1answer
143 views

SOSL syntax - Is first list element a single record?

List <Lead> results ; String searchText; public PageReference doSearch (){ results = (List<lead>) [Find :searchText RETURNING Lead (Name, email)] [0]; In the line of results, when I set ...
1
vote
0answers
175 views

Return category group with salesforce knowledge articles

I' writing one sosl query, where I'm facing problem while returning category group. FIND {tourism} RETURNING KnowledgeArticleVersion (Id, Title WHERE PublishStatus='draft') WITH DATA CATEGORY ...
2
votes
0answers
143 views

SOSL query on ContentDocument [closed]

I have a requirement to search within files. To get that working, I have a SOSL query on ContentVersion. It seemed to work as expected when I tested as myself, however... I myself seem to get the ...
0
votes
0answers
237 views

Possible to obtain Contacts and Leads with their child relationships in one query/search?

I would like to obtain all contacts and leads that match an email address but also include their related child objects (e.g. activity histories) all in one query or one search. I can't figure out a ...
1
vote
0answers
137 views

How to select the first record from multiple records from SOSL query

I am using SOSL query: List<List<Account>> acclist = [FIND :newstring IN ALL FIELDS RETURNING Account(id,Name,FirstName,LastName,Territory_vod__c,NPI_vod__c where RecordType.Name='...
1
vote
2answers
573 views

Getting Exception in SOSL:Non-selective query against large object type (more than 200000 rows)

I am using SOSL query in a method in Apex class.This method is getting called from trigger,when a custom object DCR is created. SOSL Query: List<List<Account>> acclist = [FIND :newstring ...
3
votes
1answer
579 views

Use Set in SOSL queries

Currently I am using SOQL query in apex class: for(Account acc: [Select FirstName,LastName,Territory_vod__c,NPI_vod__c from Account where Name In:accountSet ]){ accountSet is set having list of ...
2
votes
1answer
359 views

Difference between WITH and WHERE Filter conditions in QUERY?

Could you please someone let me know more about WITH and when its used as I came to know about it recently. I know WHERE and when and how its used. But when exactly WITH is used when compared to WHERE....
1
vote
2answers
3k views

can we query SOSL using REST API?

can we query SOSL using REST API? As we can do with SOQL like this : /services/data/v37.0/query/?q=
13
votes
2answers
2k views

Can SOSL perform full text search on chatter files?

The Document sobject has an IsBodySearchable flag which controls if you can full text search it via SOSL. ContentVersion has no such flag but I know that it is searchable in certain cases. However, ...
5
votes
1answer
10k views

Using SOSL with where clause

Will there be any performance impact when using SOSL with where clause? There are millions of records in one of the custom object. We need to develop custom search functionality where user can select ...
1
vote
1answer
154 views

Child relationship expressions __r in SOSL [duplicate]

Is that possible to have a child relationship expressions __r in SOSL List<List<SObject>> searchList = [FIND :searchText+'*' IN All Fields RETURNING Account (id,name,industry), ...
5
votes
1answer
832 views

What is the default sort order for records in SOSL

When you search with SOSL but do not specify an ORDER BY clause, does it sort by any particular field? Example: FIND {test@example.com} IN EMAIL FIELDS RETURNING Contact(Id, Name), Lead(Id, Name) ...
1
vote
1answer
338 views

combine two SearchGroups in SOSL search

Can I combine two SearchGroup in one SOSL query? I want to search both in Name Fields and in Phone fields. Something like FIND {78*} IN (NAME , PHONE) FIELDS RETURNING Contact(id,name,phone)
0
votes
1answer
520 views

Dynamic SOSL SearchQuery with AND Clause for Contact Firstname and Lastname

If i am trying to make a SOSL Search Query dynamic where Firstname and Lastname will be coming from remote parameter dynamically. Attached code sample is not working - But if i make the SOSL Query ...
1
vote
3answers
1k views

Fetch Min Max Value from Multiple Objects

I have 5 different objects Obj1__c, Obj2__c, Obj3__c, Obj4__c, Obj5__c Each Object has Date Field Start_Date__c, End_Date__c Now I need to find out Min Start_Date__c And Max End_Date__c . By ...
0
votes
1answer
506 views

SOSL does not find numeric fields

We have the following SOSL query to find financial transactions: List> searchList = [FIND :searchTerm IN ALL FIELDS RETURNING Financial_Transactions__c (Financial_Account__r.Nickname__c, ...
0
votes
1answer
533 views

SOSL FIND query not giving correct results

I am writing a text search query with SOSL to match exact phrase. But it's giving results like in a wildcard search. FIND {CCMS} IN NAME FIELDS RETURNING Account(Id, Name) Results : 001xxxxxxxxxx ...
0
votes
1answer
137 views

Performance issue for searchable 500+ fields

I haven't work on something like this before but what are the performance implication whether using SOQL or SOSL 500 fields+ (fields will be added dynamically as the application grows) and having 800K ...
0
votes
1answer
165 views

How to use sosl query to get records based on string

FIND {ti} IN NAME FIELDS RETURNING Account LIMIT 10 above is my sosl query to get Account Names based on ti but the problem is,it also get the field values of website whose value contains ti.is there ...
3
votes
1answer
484 views

Trailhead: Invalid conversion from runtime type List to List: No type casting required

I'm a newbie to APEX but not the platform. Yes I'm going through the trailhead Apex Basics & Database and on the SOSL module I think I have this correct but I'm getting this List to List error: ...
2
votes
1answer
2k views

How to query for articles without a data category?

I can query articles with specific data categories, for example: SELECT Title FROM KnowledgeArticleVersion WHERE PublishStatus='online' WITH DATA CATEGORY Geography__c ABOVE usa__c But what if I ...
0
votes
2answers
587 views

Convert SOQL Query to SOSL

I have a Query query = 'Select Id, Name, Email, Phone from Contact where (Id = ' + cstIdsList + ') ;' + 'Select Id, Name, Primary_Email__c, Phone from Account where (Id = ' + astIdsList + ') ...
1
vote
1answer
3k views

Query a Encrypted field in SOSL

I tried querying a Encrypted field in SOQL. Gives an error: encrypted field 'Email' cannot be filtered in a query call Can i achieve it using SOSL??
0
votes
1answer
2k views

To search Rich Text Area field [closed]

Custom field Cont__c, data type is Rich Text Area, but in the custom Visualforce Searchpage can't to search and error information: System.QueryException: field 'Cont__c' can not be filtered in ...
1
vote
1answer
583 views

SOSL query to return the count of all standard and custom objects from an org

Is there a simple SOSL query that one can use to determine the number of objects in an org? A bonus would be to determine what type of object it is (custom, standard, packaged) etc.
2
votes
1answer
581 views

Can the OR operator be used in SOSL queries?

Trying to do a SOSL query to find object matches for one of two variables. The following query is very simplified for easy reading. Any help is appreciated. String queryString = 'FIND :var1 OR :var2 ...
1
vote
1answer
233 views

Empty Result for SOSL Query List

New dev here and I am trying to make a SOSL query to pull accounts that contain a string variable. Not returning any results. Any guidance is appreciated Here's the vfp <apex:page controller="...
8
votes
1answer
2k views

Does SOSL allow the `-` dash character?

According to the documentation you need to escape the following special characters in SOSL search text. Escaping special characters & | ! ( ) { } [ ] ^ “ ~ * ? : \ ' The - dash character is ...
2
votes
1answer
107 views

SOSL working in dev org not working in sandbox [duplicate]

I am attempting to search for records that contain some text and limit the search results to a group of Ids. For simplicity, I'll remove the "search for text" part in this question. The problematic ...
1
vote
1answer
1k views

How do I change my SOQL below so that Shield Platform Encryption is supported on SSN and the query supports large amounts of data

Our company has several packages and we've recently been asked to do some analysis on how to make them compatible with Salesforce Shield field encryption. In the Shield encryption considerations doc, ...

1 2 3
4
5
7