Create Advanced Search links and search boxes
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:
https://my-library.on.worldcat.org/advancedsearch?databaseList=
- 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%2C
.
Example URL with Target IDs for Academic OneFile, Gale Virtual Reference Library, and ProQuest Newsstand:
https://my-library.on.worldcat.org/advancedsearch?databaseList=2229%2C1461%2C2622
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
The example below searches for articles held by your library published in the last 5 years. Use the values provided in the URL to customize your search box code.
https://my-library.on.worldcat.org/search?sortKey=LIBRARY&databaseList=638&queryString=code&changedFacet=year&scope=sz%3A35935&format=Artchap&database=all&author=all&year=2012..2017&yearFrom=&yearTo=&language=al
Add a link to WorldCat Discovery on your local catalog site
When a library user searches your library's local catalog and no results are found, you can provide a link to your instance of WorldCat Discovery to search further. Embed the link to WorldCat Discovery on your local catalog and pass the search query parameters on so that when a user clicks on the URL, it performs the same search that was conducted in the local catalog.
To embed your Discovery URL:
- Retrieve your Base URL.
- This can be found in the User Interface Options module of OCLC Service Configuration. Refer to User Interface Options, Your WorldCat.org URL.
- Build your search link. Use the following pattern to create your search link:
- <WorldCat Discovery base URL>/external-search?queryString=<searchterms>
- Replace <WorldCat Discovery base URL> with your Base URL.
- Replace <search terms> with the search terms you want to include. Ensure you encode any special characters in the search terms correctly.
- <WorldCat Discovery base URL>/external-search?queryString=<searchterms>
- Add the link to your site.
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.
Database parameters
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).
Target IDs
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:
https://my-library.on.worldcat.org/search?queryString=dog&databaseList=1271
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:
…databaseList=1708%2C1271…
…databaseList=1708%2C1271%2C1953…
Sort parameters
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:
Sort option | Sort value |
---|---|
Best Match | BEST_MATCH |
Recency | RECENCY |
Library | LIBRARY |
Author (A-Z) | AUTHOR |
Date (Oldest First) | DATE_A |
Date (Newest First) | DATE_D |
Most Widely Held | LIBRARYCOUNT |
Title (A-Z) | TITLE |
Scope parameters
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.
Scope option | Scope value |
---|---|
Branch |
changedFacet=scope &subscope=wz%3VALUE and sz%3VALUE Note: If multiple branches are selected, additional subscopes will appear. |
Level 1 (your library) | changedFacet=scope&scope=wz%3VALUE |
Level 2 (consortium or group) | changedFacet=scope&scope=zs%3VALUE |
Level 3 (second consortium or group) | changedFacet=scope&scope=zs%3VALUE |
Libraries Worldwide | changedFacet=scope |
Filter parameters
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=.
Filter option | Filter value |
---|---|
Content | changedFacet=content&scope=&content= |
Format |
changedFacet=format&scope=&format= |
Databases |
changedFacet=database&scope=&database= |
Author | changedFacet=author&scope=& &author= |
Year | changedFacet=year&scope=&year= |
Language | changedFacet=language&scope=&language= |
Onderwerp |
changedFacet=topic&scope=&topic= Note: Subtopics can be added to the search using the filter value &subtopic= |