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
8
votes
1answer
4k views

SOQL: Bulk Fuzzy Searching

I have a list of accounts that I would like to perform a LIKE query on. Ideally, my query would be something like: SELECT id, owner.name FROM Account WHERE name LIKE IN :entityList Is there any way ...
2
votes
1answer
2k views

Can SOSL retrieve child objects from the result set of parent objects?

I have contact object and Registration Custom Object. I want to list the registration object fields in contact object using relationship as follows: SELECT id, name, (SELECT id,name FROM ...
9
votes
1answer
198 views

SOSL query having issues with quotes (in the record(s) that should be returned, not the query string)

Tried to do some due diligence before asking this one. I have read the SOSL documentation, and have done some cursory searching here on SFSE. Scenario I have an integration with an external system, ...
6
votes
1answer
7k 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 ...
18
votes
3answers
3k 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 ...
7
votes
4answers
7k 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 ...
6
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> ...
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 ...
4
votes
1answer
185 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, ...
3
votes
2answers
1k 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
1answer
94 views

How to get list of all sobject records modified today in the system?

I need a list of all sobject records that got modified today. this is not just for one object but for all objects in the system. Is there a simpler way to do this?
40
votes
3answers
47k 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?
13
votes
3answers
9k 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 ...
8
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 : ...
5
votes
1answer
1k 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 ...
4
votes
1answer
2k 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 ...
7
votes
2answers
683 views

Duplicate IDs in sandbox - how come?

We've been struggling with an internal server error if the SOSL search text is test: List<List<Account>> accounts = [FIND 'test' IN ALL FIELDS RETURNING Account(Name, Description, ...
2
votes
1answer
221 views

Contacts with MiddleName values and queries

As per this previous question, I believe that Salesforce (still!) has a bug in querying Contact instances when middle names are enabled and set. If I have a Contact with FirstName "Mohammed", ...
13
votes
1answer
8k 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
2k 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 ...
3
votes
1answer
484 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 ...
3
votes
1answer
646 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
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 ...
1
vote
1answer
2k 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
vote
3answers
263 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
1answer
48 views

Error “Failed to get metadata of listview foo_baz for entity Account. ” when trying to search list view

I am trying to use 'search in list views' SOSL feature, but receiving the error mentioned in title. The query in itself is: FIND {fook} IN ALL FIELDS RETURNING Account(Id, Name USING LISTVIEW=...
0
votes
1answer
317 views

Dynamic sosl query not returning all events with search term in their subject

I seem to have an odd issue where for certain text phrases being searched with sosl, not all events being queried with the sosl search are returned that should be. For example: when FIND (meeting*) ...