Skip to main content

Document search

There are two main ways to find a document:

Document searches are executed using a combination of SOQL and SOSL. First, any search filters (except for product and region) included in the search are used to execute a SOQL query which returns an initial set of matching documents. Then, a SOSL query is executed against the initial matches to further reduce the search result set. The SOSL query performs a keyword search spanning intelligently selected document metadata and the first 5mb of files.

To search for and find documents in your environment, use basic or advanced document search.

Key concepts

  • Document searches can be performed from two locations: Documents tab and the Related Documents component on the document record page

  • Document filters can be configured using the CM_Document_Search_Detail layout. Visit Document layout locations.

  • Document search result columns can be configured using the CM_Search_Result_Columns_Field_Set__c on the CM_List_View_Object_Setting__mdt custom metadata type.

  • Keyword searches are executed against intelligently selected document metadata fields based on pulled up list views and the first 5mb of related files.

  • Keyword searches are case-insensitive. For example, searching for Dosing, dosing, or DOSING all return the same results.

  • Keyword searches may include search operators to perform more advanced searches.

  • Search results are ordered according to frequency, uniqueness, location, proximity, and ownership. For more information on search result order, visit Salesforce's How Are Search Results Ordered documentation.

Use basic search to search for documents in environments with less than 40,000 total documents. Basic searches are executed when at least one of the following criteria are met:

  • A keyword is included in the search

  • A Document Number is included in the search

  • Product filters are not defined

  • Region filters are not defined

  • File contents are not included in the search

Note: If the total number of possible records returned by a basic search is greater than 100 records, an exception is thrown indicating that the maximum number of Document Versions has been reached.

Use advanced search with filtering to narrow the number of Content Document records that are searched in environments with more than 40,000 total documents. Advanced searches are executed when at least one of the following criteria are met:

  • A keyword is not included in the search

  • Product filters are defined

  • Regions filters are defined

  • File contents are included in the search

If no keywords or filters are included in the search form, the advanced search returns the first page of all documents that the running user can view.

Note: If an advanced search is executed but the filter criteria are not sufficient to narrow the set of Document Versions to less than 20,000 records, an exception is thrown indicating that additional filter criteria must be included.

Operators

Note: The following can be found in Salesforce's Find developer documentation.

Search operators
OperatorDescription
*Asterisks match zero or more characters at the middle or end of your search term. For example, a search for john* finds items that start with john, such as, john, johnson, or johnny. A search for mi* meyers finds items with mike meyers or michael meyers.
" "Use quotation marks around search terms to find matches in the order you entered your search terms. A search for "monday meeting" finds items that contain monday meeting in that order. To include the words "and," "or," and "and not" in your search results, surround those words in double quotes. Otherwise they're interpreted as the corresponding operators.
ANDFinds items that match all the search terms. For example, john AND smith finds items with both the word john and the word smith. Usually if an operator is not specified, AND is the default operator. When searching articles, documents, and solutions, AND must be specified because OR is the default operator.
ORFinds items with at least one of the search terms. For example, john OR smith finds items with either john or smith, or both words.
AND NOTFinds items that do not contain the search term. For example, john AND NOT smith finds items that have the word john but not the word smith.
( )Use parentheses around search terms with logical operators to group search terms. For example, you can search for: - ("Bob" and "Jones") OR ("Sally" and "Smith")---searches for either Bob Jones or Sally Smith. - ("Bob") and ("Jones" OR "Thomas") and Sally Smith---searches for documents that contain Bob Jones and Sally Smith or Bob Thomas and Sally Smith.

Examples

Search examples
KeywordSearch Description
dosing guideThis search returns all records whose fields contain both words: dosing and guide, in any location of the text. The order of words in the search term doesn't matter.
dosing OR guideThis search uses the OR logical operator. It returns records with fields containing the word dosing or records with fields containing the word guide.
dosing AND teenagersThis search uses the AND logical operator. It returns records with fields containing the word dosing and records with fields containing the word teenagers.
dosing AND NOT teenagersThis search uses the AND NOT logical operator. It returns records with fields containing the word dosing but not records with fields containing the word teenagers.
teen*This is a wildcard search. This search returns all records that have a field value starting with teen
"dosing guide"This search returns all records whose fields contain the words dosing guide, in order, in any location of the text.

Document list view filtering

If the document you want to locate is part of a list view, you can filter the list view by keyword to find that document. Document list view filtering only sorts the documents that are part of the active list view. This means that documents that are not part of the list view but that meet the filter criteria you enter will not display.

Special considerations

Keep these considerations in mind when filtering document list views:

  • Document list view filtering is only enabled when the active list view displays between 1 and 100 document versions.

  • Typing in the filter search box matches document versions on the keyword.

  • Sorting is performed client-side.

Filter list view

To filter a document list view:

  1. Navigate to a Document list view.

  2. Click the Filter () icon.

  3. In the filter search box, enter the keyword that you want to filter the documents in the list view by.