SOSL the Salesforce Object Search Language syntax. Use this tag for questions related to SOSL and handling query ouput.

learn more… | top users | synonyms

3
votes
1answer
21 views

SOSL Search Results incomplete?

I have the following SOSL: FIND {*ball*} IN ALL FIELDS RETURNING Campaign(Name, Subscription_Center_Description__c) I have the following 3 campaigns that SHOULD show up: Name: Sportsball, ...
1
vote
0answers
24 views

related lookup global search

Is it possible for global search to return both the record that was searched and it's related record? For example, if I search an order number which is in a lookup field called "Re-Order" that is on ...
3
votes
0answers
44 views

SOSL - Combining results from multiple objects into a single result set [closed]

If you query from multiple objects the SOSL query returns a List<List<SObject>>, with each inner List sorted by relevance inside. I want to return a combined mixed list sorted by relevance ...
0
votes
1answer
29 views

Help in SOQL Query

Trying to create query for Contacts Table and Team Member Table. Would like to get data from contacts of off the Opportunity record like Opportunity ID, Contact Name, Phone. Also would like to get ...
1
vote
3answers
274 views

How to query child to parent

How to query child to parent like contact to parent..and how to query master lookup relations. select id,lastnam,(select id,name from account where accountid=conatctid)from contact
1
vote
2answers
128 views

I wanna run my SOSL to search for a string obtained by function parameter

I wanna search for a particular string obtained by my function parameter in Contact & Lead FirstName & LastName fields.. The difficulty is how to compose a SOQL statement for that,as I am ...
0
votes
2answers
28 views

How would I search for objects that begin with X

I'd like to be able to search for all leads, accounts, opportunities, etc. that begin with a character. I tried just typing one character and searching, but this resulted in "your search term must ...
1
vote
1answer
27 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 ...
0
votes
3answers
68 views

Only variable references are allowed in dynamic SOQL/SOSL

I'm trying to re-request an Asset from the database: asset = Database.query('SELECT ID, Price, Asset_MRR__c FROM Asset WHERE id =: ' + asset.id + ' limit 1'); But I get an error: Only variable ...
0
votes
0answers
32 views

Unable to Query the Deleted Records

I am able to see the deleted records in the Recycle Bin. But when we try to query the deleted records using the QueryAll/IsDeleted/AllRows keywords the query is not returning the records. However, ...
1
vote
1answer
41 views

How to use comparable interface to sort a list?

I need to use this wrapper class to sort the returned articles by the CaseAssociationCount in the KnowledgeArticle object. Just having a bit of trouble after getting the wrapper put together. Here is ...
1
vote
1answer
169 views

Get Knowledge Articles for custom lightning component

I am trying to build a lightning component that will be used as a help landing page for one of our products. So I will be filtering the data category from apex and further filters by search terms ...
0
votes
0answers
19 views

Sort Articles by CaseAssociationCount issues SOSL

Seems like Salesforce wont allow me to sort articles by caseassociation count as the parent. Any ideas how I can accomplish this? SOSL FIND {*searchTerms*} RETURNING KnowledgeArticleVersion (...
0
votes
0answers
18 views

SOSL Search in lightning

i want to display SOSL results using salesforce lightning.I am facing an issue :- SOSL returns a list of list of sobjects ,so how will i handle list of list of objects in lightning component ...
0
votes
0answers
21 views

Searching Salesforce Tags via SOSL

I am trying to search the records based on AccountTag through sosl as below: String searchQuery = 'FIND \'' + searchStr + '\' IN NAME FIELDS RETURNING AccountTag (ItemId), Resource_List__Tag(ItemId)';...
3
votes
1answer
37 views

Can we use SOSL to search content libraries

We are in the process of building a custom visual force page whose requirement is to search content libraries and files related to it based on a text entered on a search box. The requirement is to ...
2
votes
0answers
57 views

SOSL with multiple conditions not working

I have a SOSL search Query String suppliedSearchText1 = 'account'; Set<String> setselectedObjects = new Set<String>{'Account','contact'}; String SearchQuery = 'FIND \'' + ...
2
votes
0answers
47 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 ...
6
votes
1answer
235 views

Can we have a ORDER BY Clause in SOSL

I am running a SOSL Query and i want the results to be order by a particular field. System.QueryException: unexpected token: ORDER Here is the query i am building in my apex FIND 'Cisco Systems*...
3
votes
1answer
29 views

sosl exception on searching with one character

On doing a sosl search with just one character search parameter, I am getting an exception. To overcome this i have used custom error message in the catch block.However I am unable to cover the catch ...
1
vote
0answers
54 views

accessing related lookup in SOQL query

Hi I am writing a SOQL query. I use Fuse IT to check my SOQL queries. So the Query is: Select Id,Name,Material__r.APS_Account__r.FirstName, Material__r.APS_Account__r.LastName from Material_Order ...
1
vote
1answer
28 views

Can SOSL search deleted items

I'm implementing a custom view on deleted items (I'm making a 'Recycle Bin' type view for all objects of 1 type, regardless of who deleted them). So far, I'm getting the deleted items with SOQL with ...
4
votes
1answer
40 views

SOSL Behaving Differently in Spring16 vs Winter16

Has anyone else noticed a difference in SOSL on a Spring16 prerelease org? The code has not changed for over a year yet our custom search page has stopped finding results for search strings our end ...
1
vote
2answers
82 views

Full search in SFDC - Should I implement an external engine?

We have a collection of objects created by a third party application (from the AppExchange). The objects are basically job openings with information stored in many fields with different data types (...
1
vote
1answer
21 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 ...
0
votes
1answer
219 views

SOQL quey to get page layouts Names for perticular object

Requirement:I need to find How many page layouts(Name) for particular Object using SOQL query or any other method,because I have 500 objects so i cannot check manually.Please suggest How can i ...
1
vote
1answer
99 views

Highlight relevant article text display on public knowledge base

I've tried searching but can't find anything to answer my question. We've got a customised version of PKB2 on a force.com site and I'm trying to update it so we can take advantage of keyword ...
2
votes
0answers
22 views

Search in related objects fields

Is there a way to make a single SOSL query to search in fields of related objects? For example: "find all tasks related to accounts are named X*".
2
votes
2answers
127 views

QueryLocator generates scope of the Object

I am recently working with building apex batch job and I came across Database.QueryLocator which I believe can create scope of the object which is passed to the execute() method. I do not understand ...
2
votes
2answers
89 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.
4
votes
1answer
134 views

QueryException: Non-selective query against large object type (SOSL)

The following SOSL is in an Account trigger in a managed package: /* Trigger is on API 27.0 */ String acctsNamesOrd = 'PARKER/VANGUARD MGT'; Map<Integer, String> acctsNames = new Map<...
0
votes
1answer
48 views

I need to search data in account records for oerticular field

Requirement:- In account object i have one field with name approve_Profile__c. i have 1Lakh of account records. I need to check for this(approve_Profile__c) field for data. Select id,...
0
votes
1answer
91 views

What is the minimum length of SOSL search expression

While performing SOSL for one character I got exception "search term must be longer than one character", with more than one characters query is working fine. Is there any document from Salesforce ...
4
votes
0answers
84 views

Salesforce search engine vs SOSL

Below is my SOSL query - FIND {searchString} IN ALL FIELDS RETURNING Account(Id,Account_Number__c, RecordType.Name,Name LIMIT 16) 1) When I put searchString = '42430' in sosl query Query 1: ...
1
vote
1answer
32 views

System.UnexpectedException: Search unavailable thrown while deploying to prod

I am getting the following error while deploying to production : System.UnexpectedException: Search unavailable when executing an sosl search whithin my test class at the line where im doing the ...
1
vote
1answer
48 views

What is the difference between {searchString} and {searchString*} FIND clauses in SOSL

I run 2 SOSL queries - Query1: FIND {Athreya} IN ALL FIELDS RETURNING Account(Id,Account_Number__c, RecordType.Name,Name LIMIT 16) Result: 7 records whose field value contains 'Athreya' Query2:...
1
vote
3answers
82 views

SOSL: System.QueryException: Non-selective query against large object type (more than 100000 rows)

We have over 100,000 contacts to query the system to get this error. SOSL: System.QueryException: Non-selective query against large object type (more than 100000 rows) However, this error is ...
1
vote
0answers
29 views

GROUP BY Clause in SOSL (FIND instead of SELECT)

I am looking for the equivalent of the GROUP BY statement but then for a FIND query. I want to do a search on all fields of ContentVersion by a keyword and I want it to return a list of all values in ...
0
votes
1answer
176 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 :('*' + ...
3
votes
1answer
72 views

fixedSearchResults set in @testSetup method, but cannot access in testMethod

I'm new to salesforce, but have been given a task that I am puzzled on. I am given a test class with an @testSetup method which inserts relevant data for the test methods. In my test method, SOQL ...
2
votes
2answers
84 views

SOSL on Lookup Fields not working.

How do we write SOSL that searches lookup fields. Example My query looks this. "FIND \'Mark\' in all fields returning Account(Id, Name, User.Name)" Here it doesn't search User with keyword Mark. ...
0
votes
2answers
96 views

SOQL query giving error in salesforce

I am running a sample query in salesforce using jquery +Ajax but one of the query is giving me an error. query: select id from document__c where id not in (select entityid from topicassignment) ...
2
votes
1answer
172 views

SOSL Pagination

I am trying to implement pagination for SOSL search. It queries Accounts and Contacts. I thought of utilizing StandardSetController but it seems not possible with SOSL. Per documentation, SOSL can ...
1
vote
0answers
118 views

Access email subject and email body data in global search

I just noticed that in global search results, data mentioned in email body or email subject is not accessible for search results (SOSL) due to salesforce search limitations. Ref: https://help....
1
vote
1answer
122 views

SOQL query to get records from two independent objects

I have a requirement to create a report. I have three Objects : Contact, Order and Lead. Order is lookup to contact. Lead has no relation with any of these. I need to create a report with some ...
1
vote
1answer
53 views

Getting total records in SOSL query

Sorry if this is a basic query but I need to get total number of records while getting response of SOSL query. I had to use SOSL query as SOQL could not search large text fields or custom fields. So ...
-1
votes
2answers
445 views

How to get RecordType.Name from a lookup relationship - SOQL [duplicate]

I have a custom object called Employee and another object called Device Device is a lookup relationship to Employee object I'm trying to pull the Device RecordType.Name something like this: SELECT ...
3
votes
1answer
86 views

Find all records referencing a specific Account

What would be the best way to go about listing all the records that reference an Account? Lookup Ids aren't search indexed so SOSL turns up no results when looking for the Account Id and the only ...
1
vote
2answers
344 views

SOQL: Ability to search on multiple fields using Like

I'm looking a way to provide a user ability to search on multiple fields like the user can search on Name or Description or Make or Model etc.. I have the following code in my apex public ...
0
votes
1answer
23 views

Retrieve multiple Id from SOSL

I have some SF Id (18 char long) coming from a backup system and I have to check if they still exists. Is there a smarter way then do 3 SOQL? Maybe with SOSL? Something like: public static validate(...