We're trying to provide a search interface in lightning community, where user can search Accounts and Contacts. No of Accounts and Contacts are in range of 2-4 millions in our Org.

Currently, what we know, total number of records returned by SOQL queries in single transaction is 50000 records. This is putting serious limitation. Now, one may ask- why there is a need to return more than 50,000 records in a single search.

Use case is : Suppose user wants to search all contacts working in 'XYZ' City. This could be more than 50, 000 records. We don't necessarily need to return 50,000(or more) in one transaction but we want search to Happen in all applicable records(Say 90,000) so that, we can provide faceted search.

For e.g, we want to provide, along with searched records(Contacts)-top 10 Accounts (with aggregated count of applicable Contacts records) as filter option in left side bar as shown in example. if Salesforce returns only 50,000 records, then facets won't work properly and might show in-correct data.

My questions, what is community's view about Salesforce search capability:

  1. Is it suitable to build enterprise level search solution using SOQL/SOSL?

  2. It is good enough to provide options like fuzzy logic, faceted search ?

  3. Is there any other good solution(preferably public facing) someone implemented with any 3rd party vendors?


Unfortunately, Building components on top of Salesforce's platform means that you will be bound to the limitations of the platform (you will quickly find out that SOQL/SOSL has many).

The 'faceted search' you linked is Salesforce's H&T portal, which itself is built on top of an External Index - Coveo. (I work for this company).

In my experience, if you want a scalable search solution, the best is to use an external Index to query against. There are sevaral which integrate with Salefsorce:

  • Coveo
  • Swiftype
  • Algolia

If you have the resources and spare time, you can build one on top of ElasticSearch.

| improve this answer | |
  • Thanks for Comment. We'll check these tools. But one question-Where do these tools build external index(s). Does that mean, data needs to be taken out of Salesforce? – curious_techy Apr 17 '19 at 4:15
  • Yes, otherwise, you are bound to those limits – glls Apr 17 '19 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.