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

learn more… | top users | synonyms

0
votes
0answers
27 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
28 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
61 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
18 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
11 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
20 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), ...
3
votes
1answer
29 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
41 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
35 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
227 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 ...
3
votes
1answer
26 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
49 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
38 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
66 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
18 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 ...
-1
votes
1answer
122 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
71 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
21 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
77 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
57 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
101 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 ...
0
votes
1answer
45 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 ...
0
votes
1answer
56 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
78 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
22 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
47 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' ...
1
vote
3answers
70 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
27 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
133 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
67 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
71 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
85 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
140 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
83 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: ...
1
vote
1answer
98 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
46 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
299 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
74 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
248 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
22 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 ...
0
votes
1answer
40 views

How to query on Category group to find all child or subcategories. ?

I have an issue. In knowledge base i have two Category groups, One is A and other is B. Now under A i have ALL--->Subcategories. Now i want to write a query which can get me all subcategories under ...
1
vote
1answer
78 views

Showing matching keyword sentences from SOSL/SOQL results

We have a requirement to search in large text area field (for e.g. Description). We are using SOSL for the same. While showing results on the VF page we want to only few sentence from Description ...
1
vote
2answers
127 views

Querying a field on an unknown object type

I have the ID of an object that could be either an account or a contact or a few other object types and want to query the name of the object regardless of the type and pass it to a string. I am ...
0
votes
1answer
441 views

Copy field values of one object to another object (Opp to Contract)

Hi Want to transfer the value from Opp to contract. Once Opp stage is CLOSED WON it is converted into New Contract. Req: Once Contract is created, i want to transfer/copy the same field values ...
0
votes
0answers
198 views

How to search for text in Rich Text area field in Apex

i want to search a text in Rich Text area field in a custom object. As We can't use the RichTextArea field in where clause to search records,i am looking for the way to search a text. Is there any ...
2
votes
0answers
137 views

SOSL query returns only 250 records event 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> ...
2
votes
3answers
440 views

FIND {query} with special characters failing with ampersand

FIND {tim/?jacob} parses perfectly fine when running the query. FIND {tim/&jacob} gives the following error: line 1:10 mismatched character '&' expecting '}'` what am I doing wrong? ...
3
votes
1answer
182 views

Interpreting wildcards (eg, * and &) in SOSL queries through the API. Escape or not?

I have a search feature that is implemented with the AJAX toolkit to use SOSL. var results = sforce.connection.search("FIND {" + sanitize(...) + "} IN NAME FIELDS RETURNING ..."); The ...
1
vote
1answer
54 views

how to find a word in url column in a given object

I am looking for SOQL/SOSL to find records in object having a URL column with some filter(text in column( on URL column, tries like and sosl, both doesn't work. Any help ?