Document search
There are two main ways to find a document:
Basic and advanced document search
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 theCM_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
, orDOSING
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.
Basic search
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.
Advanced search
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 {SearchQuery} developer documentation.
Operator | Description |
---|---|
* | Asterisks match zero or more characters at the middle or end of your search term. For example, a search for |
" " | 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. |
AND | Finds items that match all the search terms. For example, |
OR | Finds items with at least one of the search terms. For example, |
AND NOT | Finds items that do not contain the search term. For example, |
( ) | Use parentheses around search terms with logical operators to group search terms. For example, you can search for:
|
Examples
Keyword | Search Description |
---|---|
dosing guide | This search returns all records whose fields contain both words: |
dosing OR guide | This search uses the OR logical operator. It returns records with fields containing the word |
dosing AND teenagers | This search uses the AND logical operator. It returns records with fields containing the word |
dosing AND NOT teenagers | This search uses the AND NOT logical operator. It returns records with fields containing the word |
teen* | This is a wildcard search. This search returns all records that have a field value starting with |
“dosing guide” | This search returns all records whose fields contain the words |
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:
Navigate to a Document list view.
Click the Filter () icon.
In the filter search box, enter the keyword that you want to filter the documents in the list view by.