Custom URLs can include either a single database or a group of databases.
Search Box Generator
A Search Box Generator is available in OCLC Service Configuration. This tool enables your library to configure and create advanced search box HTML code to copy and paste into your library homepage and LibGuides. For more information, see Search Box Generator.
Note: OCLC Support does not troubleshoot customized HTML code for search boxes.
Advanced search URL
To create an Advanced Search URL:
- Use this base template and replace my-library with your library's WorldCat Discovery prefix:
- Find the Target IDs for the databases you want to include in the WorldCat Discovery content list (.xlsx).
- Enter the Target IDs after the equal sign (
=) in the base template. If you are including multiple Target IDs, separate each Target ID with
When a patron clicks on the URL you constructed, they will be taken to your library's Advanced Search screen, and they will be able to search through the databases you selected to include. For more information on Target IDs, see Parameters and Target IDs, below.
Embed a search box on your website
You can embed a search box on your library's website and have options to tailor it to your patrons' needs. A basic search box will mimic the behavior of the search box on the homepage of your Discovery interface:
- The search will be keyword
- It will search your default databases
- You can use search labels and query syntax in the search box as desired
Note that you will always need to encode parameter values. For example, "databaseList=2198%2C3561" is encoded and "databaseList=2198,3561" needs encoding.
When using multiple format parameters, enter each format individually instead of as a list. For example, "format=Book,Music,Video" should be three separate parameters: "format=book&format=music&format=video".
You do not need to add parameters to your search box if you want the search box to use the defaults selected in Service Configuration. If you need to create a custom search box with additional filters, the search box code should be updated.
You can use your WorldCat Discovery search URL to determine parameter values.
- Perform a search in WorldCat Discovery.
- Select the search filters you want to use in your search box.
- The resulting URL will reflect the parameter values you've selected.
- Remove search terms from the &queryString= value to reflect &queryString=code
Parameters and Target IDs
For many libraries, the default settings configured in the Relevancy and Scoping section of OCLC Service Configuration provide the desired parameters for an embedded search box. To configure a search box with parameters different from your selected defaults, follow the instructions below.
You can configure your search box to query a particular database or group of databases (that differ from your default database selections). Limiting searches to particular databases requires database Target IDs. Find Target IDs in the WorldCat Discovery content list (.xlsx).
The Target ID is a number assigned to each collection. You can use the Target ID as a reference number when you configure access to the databases you subscribe to, when you are configuring your WorldCat Discovery search box, and when you read Google Analytics or custom reports.
Users can also modify the databases used for a search by editing the database Target ID(s) in the URL. This option is especially useful if you perform a search and then wish to quickly modify the database(s) you are searching. Target IDs are included in the content list.
Note that if you add or change a database via adding or changing a target ID in the URL, your new database selection(s) will display as a selected database in search results and in Advanced Search.
Example Target IDs and associated collections:
1271 Business Source Complete; 1708 Academic Search Complete; 1953 ERIC
URL after searching Business Source Complete:
The URL can be modified to add a second and a third database to the search. The Target IDs are separated by %2C as shown:
By default, the sort preference configured in Service configuration for Default sort will appear in your search string. To specify a different sort option for your advanced search box, replace the default value for sortKey= with the selected value below:
|Date (Oldest First)
|Date (Newest First)
|Most Widely Held
By default, the scope preference configured in Service configuration for Relevancy and Scoping will appear in your search string. To identify a different scope for your advanced search box:
- Perform a search in your WorldCat Discovery.
- Select the scope parameters you want to use in your search box and run the search. The resulting URL will reflect the parameter values selected.
- In the URL, the scope values follow changedFacet=scope.
changedFacet=scope &subscope=wz%3VALUE and sz%3VALUE
Note: If multiple branches are selected, additional subscopes will appear.
|Level 1 (your library)
|Level 2 (consortium or group)
|Level 3 (second consortium or group)
To create a search box using specific filters:
- Perform a search in your WorldCat Discovery.
- Select the filter parameters you want to use in your search box and run the search. The resulting URL will reflect the parameter values selected.
- In the URL, the filter values follow changedFacet=.
Note: Subtopics can be added to the search using the filter value &subtopic=