Create Search Content
The Search content type is used to create search functionality on your site. There are two components to search: the search form and the search results.
To simplify your list of content items, it is a best practice to create only one content item for search, and assign the basic results and basic form content templates to it. (Every time a search results component is placed on a page, it affects the way the page is rendered. It will always be rendered on demand; i.e., no page caches will be used.)
The search feature uses the native Salesforce Object Search Language (SOSL), which determines whether an individual record within an object contains a field that matches the search term. All fields in every object that is involved in constructing a page and its content are searched.
Here are a few tips for constructing search terms:
- You can search complete words but not partial words (in the absence of a wildcard character). For example, gui will not return results for guitar.
- You can search complete phrases by surrounding the phrase in quotation marks. For example, “guitar case” will return results for guitar case but not guitar with case.
- You can use an asterisk as a wildcard character to match zero or more characters at the middle or end of the search term. For example, gui* will return results for guitar, guitars, guide, guild, etc.
- You can use a question mark as a wildcard character to match exactly one character at the middle or end of the search term. For example, guitar? will return results for guitars but not guitar.
- You can use AND, OR, and AND NOT logical operators to focus your search. For example, guitar AND case returns results with both the word guitar and the word case. Searching guitar OR case returns results that match the word guitar, match the word case, or match both words. Searching guitar AND NOT case returns results that match the word guitar but not the word case.
- You can use parentheses in conjunction with logical operators to further refine your search. For example, guitar AND (“case” OR “sheet music”) will return results that contain the word guitar and either the word case or the phrase sheet music, as well as results that contain the word guitar and the word case and the phrase sheet music.
OrchestraCMS determines the relevance of each page based on the number of record matches that exist on a page; the number of occurrences of the search term within a single record is irrelevant.
For example, the Page record associated with a page could match the search term in both the Title and Keywords fields, but this would count as a single match toward calculating the relevance of the page. If a page contained two content items where both of the Content records matched the search term in one or more fields, this would count as two matches toward calculating the relevance of the page.
The following table provides an example of how relevance between two pages is determined.
Page relevance in search | ||
|---|---|---|
Page 1 | Page 2 | |
Page contents | This page contains two content items. Both the Title and Keywords fields in the Page record match the search term (one record match). The Name field in the Content record of one content item matches the search term (one record match). The other content item is not associated with any record that matches the search term. | This page contains two content items. The Title field in the Page record matches the search term (one record match). The Value field in an Attribute record associated with the first content item matches the search term; this could be text entered in a field in the content editor (one record match). The Value field in two Attribute records associated with the second content item matches the search term; this could be text entered in two separate fields in the content editor (two record matches). |
Record matches | 1 x Page record match 1 x Content record match | 1 x Page record match 3 x Attribute record matches |
Relevance | Total record matches = 2 | Total record matches = 4 Higher relevance |
To increase the relevancy of a page for a specific search term, make sure to use the term in ways that will store it in multiple Salesforce records. For example, use the term in the following locations as appropriate:
- The Name, Title, or Keywords field in the page properties (stored in a Page record)
- The Name field in the content properties for content items on the page (stored in a Content record)
- One or more fields in the content editors for content items on the page (each field is stored in a separate Attribute record)
The search feature does not search the following items:
- Content that is dynamically displayed on a page (e.g., using the Taxonomy Loader or Dynamic List content templates)
- Media library files
- Taxonomy categories assigned to a page or its content items
If you have private sharing or targeting enabled for your site, users can only see the search results that relate to pages and content to which they have access.
Additional options for searching content are available in OrchestraCMS Extensions:
- Taxonomy-filtered content search
- Salesforce Library content search
- Google Custom Search
Basic Form
The Basic Form content template is used to create a search form. The search form can be placed on any or every page of your site. In the content editor, the search form must be associated with a results page that the user is directed to after they enter a search term.
To associate the search form with a results page
- In the content editor, click in the Results Page box.
- In the Select Link dialog, select the page that was created to display search results; this page must contain a content item that uses the basic results content template for it to function correctly.
Basic Results
The Basic Results content template is used to create a list of search results. Since your search form must link to a search results page, it is a best practice to create the search results page prior to or at the same time that you create your search content item. Your search content item using the Basic Results content template must be placed somewhere on the results page.
The Basic Results content template has no properties to be set in the content editor. The results display page names and descriptions, if available.