The Search Template allows users to search for content on your site. It can generate suggestions while a search term is being typed, "search instead" should no results be found, and allow users to refine their results with facets.
If facets have not been configured, an article using the Search Template does not display any results until a search has been performed.
If facets have been configured the article will display a list of all items that match the defined facets, ie a search on the wildcard "*"
1. Design
- Page title and content
- Search input
- Results information
- Search results
- Navigator
- Facets
1.1 Page Title and Content
The page title and content, including inline elements, appear at the top of the page as per the Default Template.
1.2 The Search Control
The search control consists of a text input box and search button. The appearance and position of these elements will vary depending upon the website's theme. The following behaviour is consistent across themes.
1.2.1 Search Roots
The Search Template can be configured to search for site pages, site media, or both. Content roots can also be set, limiting the search to a selection of the site's pages, or defined groups of media items.
1.2.2 Search Suggestions
The Search Template can be configured to show search suggestions.
After the first three characters of a search term have been entered, a list of up to four search suggestions is displayed in a drop-down list beneath the text input box. As each character after the third is entered, the list updates. The list includes the four most likely content items (either articles or media, depending upon the content that the Search Template has been configured to return) based upon the current text in the input box.
While the search suggestions list is displayed, the keyboard up and down arrows can be used to scroll through the list. As items in the list are highlighted, their title replaces the text in the text input box. This does not cause the list to refresh. Highlighting search suggestions on mouse-over does not replace the text in the text input box.
1.2.3 Search Operators
By default, the Search Template will return results containing any word entered into the text input box. For example, searching for example form will return all items that contain the word example or the word form.
1.2.3.1 Exact Phrase
Wrapping a search term in quotation marks will search for an exact phrase. Searching for "example form" will return items than contain the phrase example form. It will not return results for form example.
1.2.3.2 And
Using and will return items that include the words immediately before and after the word and. Searching for example and form will return items that include the both the words example and form anywhere in their content.
1.2.3.3 Excluding Words
Placing a minus symbol before a word will exclude items that include that word. For example, searching for example -form will return items that include the word example but not those that include the word form. Should an item include both example and form, it will be excluded.
1.2.3.4 Wildcard
Using an asterisk will perform a wildcard search. Asterisks can be used as placeholders in exact phrases or and operations where a term is not known.
1.2.4 Performing the Search
Several actions will trigger the search.
1.2.4.1 Keyboard Enter Key
Pressing the Enter key will perform a search based upon the current text in the text input box.
1.2.4.2 Search Button Mouse Click
Clicking the search button will perform a search based upon the current text in the text input box.
1.2.4.3 Search Suggestion Selection
A search suggestion can be selected by either clicking a listed item or highlighting it using the keyboard arrows and pressing the Enter key.
Selecting an article from the suggestion list will take the user directly to that article. Selecting a media item will perform the search again, using the full title of that item.
1.2.5 Search Instead For
The Search Template can be configured to perform a secondary search, should a search term be submitted that would otherwise return no results.
The search term will be a word or phrase that is similar to the one entered by the user. Where an alternative search term has been used, a message will be shown in the following format:
Searching on <query> found no results. Searching instead for <suggestion>
Where <query> is the original query and <suggestion> is the alternative search term that that was used for the search.
1.3 Search Results
1.3.1 Search Result Statistics
Once a search has been performed the following text will be displayed below the search control.
Searching on "<keywords>" found <NumResults> results - Page <PageNum> of <TotalPages>
Where:
<keywords> = the keyword(s) used for the search
<NumResults> = the number of results returned
<PageNum> = the number of current page of results
<TotalPages> = the total number of result pages
Where the number of results produce only a single page of results, the text Page <PageNum> of <TotalPages> will be omitted.
1.3.2 Pagination
Paginated search results will appear beneath the search result statistics. The number of items per page is configurable. Where there are more results than will fit on a single page, a page navigator is displayed beneath the search results. The behaviour of this navigator is the same as that described for the List Template.
1.3.3 Result Listings
1.3.3.1 Article Results
Articles returned by the Search Template display their title, the article URL, and a description, if available.
The title is the article heading text, which can be overridden using the article's alternate link text. It acts as the link to the article.
The article URL will be constructed as per the URLs used throughout the site. The article URL does not act as a link.
A description of the article will be shown beneath the article URL. The description will be taken from text entered into the GOSS iCM Article Editor in the following order of preference:
- Summary text (if available)
- Introductory text (if available)
- Body text (if available)
- Ellipses (should none of the above be available)
1.3.3.2 Media Results
Media items returned by the Search Template follow the same style conventions as article items.
The top result in the example image shows a media item with a single component. The result is made up as follows:
- The title of the media item which acts as a link to that item
- The URL of the item
- The description of the item as entered in the GOSS iCM Media Library
The bottom result in the example image shows a media item with two components. The result is made up as follows:
- The title of the media item
- A list of components, made up of the component name and URL. The combined name and URL act as a link to that component
- The description of the item as entered in the GOSS iCM Media Library
1.4 Search Facets
The Search Template can be configured to display facets, allowing users to refine their results. Facets are organised into groups, the titles of which are content managed. Each group holds a particular facet type, one of:- Content Root (articles or media in a certain group or section)
- Media Type (for example, PDFs, or Word documents)
- Metadata (items tagged with the selected metadata values)
- A custom SOLR query
- Date (either created or last modified) which will appear as either a month or year facet, within a defined range set
- Metadata Property (automatically builds facets from all of the values of the selected property)
The names of most facets (excluding date and metadata property) are also content managed, see the user guide for details. After each facet, the number of results that match that facet is displayed in brackets.
As facets are selected they are added to the "You selected" panel. Individual facets can be deselected by clicking on them, or all facets can be removed by clicking "Clear all".
Facets only appear if there are results that include those facet types. For example, if you created a date range facet for content created before October 2005, and the search results only returned items created after that date, the facet would not appear.
Similarly, if the search returns results that only match one facet in a given group, the group will not appear. For example, if article root facets were created for "News" and "About Us" and the search results only contained articles from the "News" section of the site, the article root facet would not appear.
Note that facets are applied after initial results have been returned. This means you may have a total number of results that exceeds the sum of the numbers in brackets listed after each facet type, because there may be results that don't correspond to any facet but do contain the search term.
1.4.1 Selecting Facets
As facets are selected the list of results updates to only include items that meet the requirements of the selected facets. The list of relevant facets will also update. For example, should facets exist for media types, created date, and metadata, and a user selects a metadata value that is not used by any media item, the media types facet group would disappear.
1.4.2 Combining Facets
Most facets behave exclusively within their group. For example, selecting a facet from an "article root" group would display results from that root and hide the other "article root" facets (because an article can only be in one root). Others, like metadata property and date range, behave inclusively, that is, you could select the date facet for December, and the facet for January, and the facet for February, returning a greater number of results as more are selected.
Inclusive | Exclusive |
Metadata Property | Content Roots |
Dates | Media Type |
Metadata Value |
1.5 Related Assets
Related assets, such as media items, links and features, display as per the Default Template.
2. Configuration
The core search needs relatively little configuration. Adding facets to your search is optional.
2.1 Configuring the Search
The following options are available in the article extras of an article using the Search Template.
- Items per page. The number of search results per page
- Enable "Searching instead for". Whether or not search terms that return zero results should trigger a secondary search using a similar word or phrase
- Enable "Search suggestions". Whether or not a drop-down list of suggested search terms should be displayed as a search term is typed into the search box
- Search Bar Placeholder Text. Text that will be displayed inside the search text input box before the user starts typing
- Collections. If the search should return articles, media, or both
- Root Articles and Root Media. These two selection boxes allow a user to restrict the search to a defined section of the article tree (the child articles of the parent articles selected) or a limited number of media groups. A site search will often use the site homepage as its content root, so that all site articles are returned. If no content roots are chosen, the content roots for the subsite are used.
Care should be taken as "hidden" articles (articles that are children of parent articles that have their display set to "no") will be returned in the search. Articles in the "hidden" section are simply hidden from the site navigation menu, not the search. To exclude articles from the search, either don't pick their parent articles in the Root Articles picker, or exclude them from the search using their "search boost value".
2.2 Search Facets
Facets are organised into groups. There are three types of group, and each group holds a different type of facet. You need to enter a name for all group types, which will appear above those facets on the search page.
2.2.1 Dates Group
To add a date facet, click "Add group" and select DATES from the drop-down.
Select the dates between which you would like facets to be generated. If you'd like date facets to cover all of the content on your site, it's a good idea to set the From date to a time before content was created on your site, and the To date several years into the future (so that you don't have to keep rolling the end date forward).
The Query Field drop-down lets you choose whether articles and media are faceted based upon when they were created or when they were last updated.
Facet Mode sets whether the facets appear as months or as years.
For example, the following DATES group in iCM would create these facets on the site:
When a user selects a date, only the search results created or updated in that month or year will be displayed. As more dates are selected, more results are shown.
2.2.2 Metadata Property
To add a metadata property group, click "Add group" and select METADATAPROPERTY from the drop-down.
Use the Select button to pick a metadata property.
The metadata property facet group generates facets automatically using the values of the chosen property, there's no need to manually add facets to the group.
For example, the following METADATAPROPERTY group in iCM would create these facets on the site:
The values of the "Contributed Events" property appear as facets (as long as there are articles that are tagged with those values). When a user selects a facet, only results that are tagged with that value will be displayed. As more value facets are selected, more results are displayed.
2.2.3 Simple Facets
The simple facet group is a container which can hold any number of facets of any type, although it generally makes sense for all of the facets in one group to be of the same type. The four types are CONTENTROOT, MEDIATYPE, METADATA and CUSTOMSOLRQUERY.
2.2.3.1 Content Roots, Media Types and Metadata Values
These facet types let you pick content, or types of content, that will act as facets for the search results.
An article root facet filters search results to articles beneath a particular article. A media root facet filters search results to media items in the chosen group. As articles can only exist in one root, and media items can only exist in one group, these facets act exclusively, that is, you can only select a single article root or media group facet at a time.
The media type facet filters search results to just that media type, for example, selecting a PDF facet would only display PDFs.
Metadata value facets filter results based upon items tagged with those values. Unlike the metadata property group described in section 7.2.2, you are able to select exactly which values will be used, and they can come from a variety of different properties.
Once you've created a simple group, use the "Add facet" button to create the individual facets.
For example, this group has two article root facets, each corresponding to a different area of the site:
2.2.3.2 Custom SOLR Queries
The CUSTOMSOLRQUERY facet type provides a free-text area that allows you to enter a SOLR query in the same format as you would from the SOLR admin console. Building custom SOLR queries is beyond the scope of this documentation.
3. Article Extras
Field Name | Type | Description |
---|---|---|
ITEMSPERPAGE | Number | The number of results to display per page |
SEARCHINGINSTEADFOR | Drop-down | Yes/No to enable search instead |
SUGGESTIONS | Drop-down | Yes/No to enable search suggestions |
SEARCHBARPLACEHOLDER | Text | Placeholder text for the search bar |
COLLECTIONS | Checkbox Group | Articles/Media - if checked will be searched |
ROOTARTICLES | Asset Lookup (multiple articles) | The root articles that will return content in the search |
ROOTMEDIAGROUPS | Asset Lookup (multiple media groups) | The media groups that will return content in the search |
Various facet fields | Various | All of the facet configuration is interdependent and held in a single layout field |