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
1answer
18 views

Need Better Search Conditions on Duplicate VF Page [on hold]

I have an apex class that brings up duplicates when a user enters in an account name in the search box on the visualforce page. Right now, the search takes the exact letters written into the search ...
6
votes
2answers
90 views

Sanitize a string before injecting it into SOSL

Is there a way through the .net framework or some other package to sanitize strings so that they can be safely used in sosl? Is there any larger standard that SOSL falls under? I was able to find How ...
4
votes
0answers
30 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, ...
1
vote
1answer
17 views

Problem with WHERE Clause in SOSL to search KnowledgeArticles

I am trying to search case,solution and KnowledgeArticles with following SOSL FIND 'lithium' RETURNING Dissusion__kav (Title, Summary, LastPublishedDate, KnowledgeArticleId, UrlName WHERE ...
3
votes
1answer
66 views

SOSL FIND verses SOQL WHERE

Is there any way to convert SOSL Find clause into SOQL where clause ? For example following SOSL and SOQL both have same filter criteria. SOSL: FIND {'ABC' and 'XYZ'} IN ALL FIELDS Returning ...
2
votes
1answer
40 views

Field level security and UI search / API search

I have noticed that if I use field level security to hide a field for a custom profile, a user in the profile can still global search for text in that field and the record will appear in the results, ...
4
votes
6answers
338 views

Most efficient (instant / no Batch) way to mark thousands of records as dirty

I have the requirement to store and retrieve the information that a set of arbitrary sobject records are "dirty" and need to be touch by asynch processes. I am talking about 10.000 to 100.000 records ...
4
votes
1answer
135 views

Escaping reserverved characters in SOSL queries

Escaping reserverved characters with backslash as described in Force documentation (http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_sosl_find.htm) give unexpected ...
4
votes
1answer
71 views

Clarification on Unit Testing a method that runs a SOSL query

I have a controller method that uses a SOSL query to generate a list of options. It works when used in the VF page, but the unit test is failing; logging shows the SOSL query is returning no results. ...
6
votes
3answers
137 views

How do I SOSL across objects, matching all records with FIND clause?

To all the expert SOSL gurus lurking out there, I thought this will be an interesting one: I have some SObjects of different types and I want to return their Name values in a single query. In ...
0
votes
2answers
156 views

How to Search contacts using wildcard characters(*,%,?) in salesforce

Please give me answer for "How to Search(box) list of contacts using wildcard characters(*,%,?) in salesforce "
4
votes
2answers
166 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 ...
1
vote
1answer
68 views

Doubts on SOSL limits

I am trying SOSL for first time and have some questions related to limits. As per document http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_sosl_limit.htm It says, ...
5
votes
1answer
104 views

Can SOSL be used with more record than SOQL?

Because our client has a LOT of records (I have no idea how much), my colleagues feel it is necessary to use a SOSL query rather than a SOQL query, but I've never heard anything suggesting that SOSL ...
3
votes
1answer
79 views

Issue with SOSL search API

I am using salesforce API to do a SOSL search with the CJK charcters. But I am getting more irrelevent results. So when I search in the salesforce doc I got an information like "In Chinese, Japanese, ...
3
votes
1answer
69 views

SOSL Filter by Library on Salesforce Content

Is is possible to search Salesforce Content in a specific library (ie. ContentWorkspace)? According to the Content data model, it seems the relationship between ContentWorkspace and ContentVersion ...
3
votes
1answer
194 views

SOSL and “ends with” wildcard

I am trying to implement a SOSL search function that uses an "ends with" wildcard, like *searchString in SOQL. No luck! I know about this limitation of SOSL Asterisks match zero or more characters ...
3
votes
0answers
69 views

How can I access Record Tags and/or Content tags via Apex & SOQL & SOSL

I have a requirement to produce a unified search across Salesforce records using tags and documents in Content. Both records and Content items may have received the same tag from a user and my ...
3
votes
1answer
158 views

SOSL - Return correct related record type

I'm having an issue with the type field on related records from an SOSL search. In our organization, Leads can be owned by either a User or a Group/Queue and Accounts can only be owned by Users. ...
6
votes
2answers
151 views

Check if a .txt file of IDs all exist in Salesforce

I receive a .txt files of type ID, e.g. 003U000000PL9LN, 001U000000PL9LM, a1fU000000PL9LO. I need to check if these IDs correspond to valid objects within Salesforce. I have a List of IDs in Apex. ...
1
vote
2answers
326 views

SOQL query by data type

Is it possible to query fields by datatype? I need to query all email fields from different objects. Email field names are different on each object and not known in advance. So I am trying to query by ...
2
votes
1answer
136 views

How to order SOSL results by relevance

How can I order the results of a SOSL query by relevance, meaning the result with the most matches of my OR term first? I have an Apex class that uses SOSL to find potential duplicates for a new bug ...
3
votes
1answer
710 views

How to Search a text in all fields in all objects and return all values?

Can I find a string from all fields from all custom and standard objects and return the data (all field data) of all the records that matches for all the fields of those objects?? Also is there an ...
1
vote
2answers
506 views

Using SOSL to find all related records

I am trying to write a query to find all child records of a parent record. I know I can do this with a SOQL on each child object, but I want to do something slicker. For example, my parent object is ...
3
votes
1answer
256 views

Knowledge - How to filter SOSL results by a SOQL and save on API calls?

My organization frequently does work with SalesForce knowledge. And the recommended way to search Knowledge is either by the exact type of the article that you created in your instance or by the ...
3
votes
1answer
213 views

Search formula fields using SOSL

Im trying to build a custom job board search on visualforce. I have a positions object which has a relationship has a master detail field to account. I'd like the search to return positions when you ...
6
votes
3answers
204 views

How to search for a long list of arguments

We have reports to search all cases that contain certain serial numbers (strings) in a custom text area field that can contain a comma-separated list of serial numbers. Additionally, serial numbers ...
2
votes
2answers
118 views

Unable to Access Page

I get the following error when I run the following class: public with sharing class CaseUpdatePriorityEmailBodyMisc { public void updateCaseWhenDiscriptionFindBadWord(){ List<Case> ...
6
votes
3answers
302 views

What is the maximum number of rows that SOQL and SOSL can “scan”?

It's quite clear from the governor limits documentation how many records can be returned, and the docs do mention that SOQL in a trigger will scan a maximum of 100k records. So my questions are: For ...
5
votes
1answer
115 views

What is the max length of a SOSL search expression?

My SOSL query with an extremely long search expression failed with System.UnexpectedException: Search Term exceeded max length Searching the Documentation I could not find anything about a max ...
12
votes
3answers
459 views

Why is SOSL in Test not working?

I have a Custom Object that contains a long text area with 32.000 chars full of comma-separated Ids. I need to find all such records that contain one or more ids. I tried to implement this in this ...
3
votes
1answer
102 views

Custom indexes in SOSL

We are planning to use SOSL to search for a phone number on all phone fields in the Account object, and in our custom Address object. I know that when we use SOQL, performance can be improved by ...
8
votes
1answer
296 views

How long does it take for Salesforce to build the SOSL index?

After adding new data to Salesforce, the records do not show up immediately in SOSL queries or the Salesforce search interface. How long does it take for new information to be indexed? I'm looking ...
6
votes
1answer
349 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 : ...
16
votes
2answers
6k views

SOQL vs SOSL - Which one to use and when?

What arguments can be made to use SOQL or SOSL? When would you use one over the other? What is the main difference?
9
votes
3answers
1k views

Is there any way to filter a SOQL or SOSL query on the Id field?

I've tried a number of ways including: SELECT Id, Name FROM Account WHERE Id LIKE '0013%' and FIND { 0013 } IN ALL FIELDS RETURNING Account (Id, Name) and all I receive is the same ...
1
vote
2answers
208 views

How to build a Stackexchange-like search while typing in Salesforce

We have an internal defect tracker in Salesforce which should have much more of the charming features of Stackexchange. One feature that I love the most is the live-search for duplicates while ...
6
votes
1answer
385 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: ...
5
votes
1answer
203 views

Implementing a Keyword Search

A more detailed explanation follows, but the core of my question is: what are best practices for implementing a general keyword search in SOQL/Apex? In an app that I'm building, we're using a data ...
5
votes
1answer
134 views

Relationships in SOSL

Can I use relationships in SOSL? Example: Find all first names that start with 'Roc' within Position__c FIND \'Roc*\' IN ALL FIELDS RETURNING Position__c(Id, Contact__r.FirstName WHERE Title__c = ...
4
votes
2answers
517 views

Apex SOSL Paging Implementations

How might one implement SOSL paging, i.e. get the next 200 results, in Apex?