A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
0answers
236 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, ...
2
votes
1answer
590 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 ...
2
votes
1answer
4k 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
36 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 (...
2
votes
1answer
243 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
456 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 \'' + ...
3
votes
0answers
483 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 ...
8
votes
1answer
824 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
240 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
162 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 ...
2
votes
1answer
226 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
46 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
257 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
434 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
4k 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 ...
2
votes
1answer
650 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
42 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*".
3
votes
2answers
948 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
868 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
598 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
57 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
1k 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
1answer
267 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: ...
2
votes
1answer
336 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
74 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
241 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 only ...
1
vote
0answers
150 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 ...
-1
votes
1answer
883 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
192 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 ...
3
votes
2answers
995 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. ...
1
vote
2answers
485 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) ...
3
votes
1answer
506 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
609 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
760 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
525 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 ...
0
votes
2answers
4k 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
773 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 ...
3
votes
3answers
2k 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
59 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(...
0
votes
1answer
104 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 A....
2
votes
1answer
185 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
990 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 doing:...
-1
votes
1answer
2k 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 ...
2
votes
1answer
1k views

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

i want to search a text in Rich Text area field of a custom object. Since We can't use the RichTextArea field in the where clause of SOQL, I am looking for the way to search a text. Is there any way ...
5
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> ...
3
votes
3answers
2k 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
759 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 sanitize(...) ...
1
vote
1answer
149 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 ?
2
votes
1answer
1k views

Getting SOQL/SOSL Injection error when I send my code for security review

I have send my code for security review I am getting error for SOQL/SOSL Injection. I have made the changes on the bases they have mention in report. But even I am getting issue with dynamic soql I am ...
2
votes
1answer
4k views

How to query on OData(External Object) in Visualforce search page. using search string

I am trying to write a query on External Object using LIKE operator but its showing as error like, it is limited to use LIKE operator for OData Query. Is there any alternate way of querying? SELECT ...