Search scopes
Provide your visitors with alternative content groups to search through
Error message
Notice: unserialize(): Error at offset 5863 of 11211 bytes in variable_initialize() (line 1255 of /mnt/www/html/oxforddev/docroot/includes/bootstrap.inc).By default, your site has one search scope, which is the content of your website. You can create additional search scopes to give your visitors alternative content groups to search through.
Up to three search scopes can be displayed on your site's search results page — see example below.
Three types of search scope can be created:
- Search collection. Specify a group of other Mosaic sites that you want to let your site's visitors to search across. This scope type supersedes the legacy Shared search functionality*
- Section search (available when Section search is enabled for the site). Specify a subset of your site's pages that you want to provide a focused search scope for. This scope type is mainly for use in the Section search widget but can be displayed on the search results page too. Contact the Mosaic team to request section search
- External search. Specify an external search service that your visitor's can pass their search term on to, and allow them to continue their search on that service
*Shared search collections that were created before the introduction of search scopes were migrated to new search collections as part of the release of this functionality.
- Go to Site Settings > Search tab > Search scopes section > click the link to 'manage your Search scopes'
- Select the search scope type: 'Search collection'
- Provide a name for the the collection [see 1 in the example above] — this will be displayed to your site's visitors on the Search results page
- Add the primary domain of each site you want to include in the collection [see 2 in the example above] — this can either be the '[prefix].web.ox.ac.uk' format domain or a custom domain for the site
- Click 'Look up sites' to run the validation check that makes sure the domains are for Mosaic sites [see 3 in the example above]
- The results of the look up are displayed to the right of the domains input field [see 4 in the example above]. If a domain/domains aren't in use on a Mosaic site, a validation notice 'No site found' will display in the look up results, next to the domain name [see 5 in the example below]. If this happens, check the domain(s) displaying the notice are entered correctly, amend them and click the 'Look up sites' button again to re-run the validation.
- Click 'Save'
- An entry for the search collection will be displayed in the Search scopes summary table. The collection can be edited or deleted from the summary table
Displaying another site's content in your search collection
When a site (Site A) adds another site (Site B) to a search collection:
-
Site B won't be informed that its content can be searched from Site A
-
Site B is not automatically able to search across content on Site A. To enable reciprocal shared searching, Site B will need to setup a search collection which specifies Site A
Section search scopes are mainly used used with the section search widget, though they can also be used on the search results page. See the Section search documentation for help creating a section search scope.
When a visitor on your site's search results page clicks the external search scope tab, a new browser tab is opened and a search is performed on the search service you've specified for the scope using the terms the visitors used on your site's search — see the example user journey for using external search below.
- The website visitor searches for a term on the Mosaic site
- The visitor chooses the external search from the scope tabs on the search results page
- A new browser tab is opened and a search is run on the specified external search service using the term the visitor entered on the Mosaic site
To create an external search scope:
- Go to Site Settings > Search tab > Search scopes section > click the link to 'manage your Search scopes'
- Select the search scope type: 'External search'
- Provide a label for the external search scope (maximum of 20 characters) [see 1 in the example above]. This will be displayed in a tab on the search results page. An 'external-link' icon will be displayed next to the label text
- Provide search URL for the external service [see 2 in the example above]. You will need to provide a URL which includes the appropriate search query parameter for the service you want to use, and a placeholder for the search terms:
- Search query URL. To get a URL which includes a search query parameter, go to the search service you want to use and run a search. Note the URL structure for the search results page and copy the URL from its beginning up to and including the first instance of the '=' character, for example:
- DuckDuckGo query URL: 'https://duckduckgo.com/?q='
- Bing query URL: 'https://www.bing.com/search?q='
- Google query URL: 'https://www.google.com/search?q='
- www.ox.ac.uk (main Oxford website) query URL: 'https://www.ox.ac.uk/search?query='
- Placeholder for search terms. This is the character set '$1'. '$1' will be subtituted for the visitor's search term when the external search page is loaded
- Search query URL. To get a URL which includes a search query parameter, go to the search service you want to use and run a search. Note the URL structure for the search results page and copy the URL from its beginning up to and including the first instance of the '=' character, for example:
- Click 'Save'
- An entry for the external search scope will be displayed in the Search scopes summary table. The collection can be edited or deleted from the summary table
You can display up to three scopes on the search results page.
Note about the default search scope
This is the scope that is displayed when the search results page loads. The 'This site' scope (for the current site's content) is set as the default scope and is displayed in the first search scope position (the left-most tab on the search results page). Another scope can be set as the default and can be displayed in the first scope position. Also, the 'This site' scope can be removed from the search results page using the display options.
To display a scope on the search results page:
- Go to Site Settings > Search tab > Search scopes section
- Under 'Search scope selection', choose the name of the scope you want to display from the dropdown list next to the scope position — for example, 'Search scope two'
- Choose whether to set the scope as the default using the radio option 'Set scope [number] to default?' (external search scopes can't be set as the default)
- Save the settings
- A tab for each scope will be displayed on the search results page