Synonyms let the Marketer steer queries to pages containing related vocabulary.
Synonyms are an App-level feature.
How It Works
How the synonym feature works:
- The business user enters a synonym pair, consisting of a trigger phrase and a synonym phrase.
- When a query contains the trigger phrase, Site Search automatically inserts the synonym into the query string.
Note: Synonyms apply only to tokenized (full-text) search fields. They don't affect fields indexed as non-tokenized strings. Tokenized fields split text into terms so queries can match individual terms. For consistent results, include at least one tokenized field in your Search Fields list, and make sure the fields you expect synonyms to affect are tokenized. In Drupal, you can set a field's data type to Fulltext to make it a full-text field.
Key Benefits
- Synonyms transparently guide the search user to relevant content by broadening the query.
Setting Up Synonyms
Synonyms can be set up manually, and can also be uploaded from TXT files.
Avoid Special Characters!
When entering your synonyms, please do not use hyphens, apostrophes, or accented characters.
Manual Entry
To enter a synonym pair manually:
- Enter a trigger word/phrase in the Word field.
- When this phrase appears in a query, it triggers a synonym expansion.
- Solr synonyms must be literal strings. They do not support any kind of regex or wildcard operations.
- Select a right-arrow (→) or a double-arrow (↔) in the Is droplist.
- a right-arrow (→) will replace the word on the left at query time and index time to the word on the right
- a double-arrow (↔) will expand the words at index and query time
- Enter the synonym phrase in the Synonym to field.
- This phrase will be inserted in the query string to broaden the search results. If you would like to enter multiple terms, separate them by commas.
- Click the plus button (+) to add the synonym pair to the list of synonyms.
- Click the Publish button to make the change active and persistent.
- Both the Draft and Publish buttons save your changes. Publish makes the changes visible in the Search Experience.
When you save a draft, Site Search shows a blue dot in the navigation menu to indicate pending changes for the current app, language, and search profile. The configuration page also shows a banner. Status banners show pending draft, saved draft, and published states.
Upload a File
Site Search lets you upload a dictionary of synonym pairs.
- Prepare a plain text
.txtupload file as described in Synonyms: Upload Format. Each line should contain one synonym rule. For example:car => automobile faq => frequently asked questions laptop,notebook,computer- When you upload a file, it appends words to the previous list.
- Duplicate entries are ignored.
- Maximum file size is 10MB.
- Site Search can accommodate up to 25000 synonym entries.
- Use the Choose File button to select the file.
- Click Upload.
- The new synonyms will appear in the list.
- Review the imported synonyms, then click Publish to make them active in the Search Experience.
Table Utilities
The table of synonym pairs offers some convenient features:
- At the left are controls to select one or more synonym pairs for global operations (such as delete).
- Click on a column heading to re-sort the table by the values in that column.
- On the right are controls to:
- Filter the list by searching for a keyword.
- Download the synonyms to a CSV file.
- Delete selected synonyms.
Examples
Some synonyms are one-way, while others are symmetrical. For the example below, when the user types in “William,” Site Search will replace the term with “Bill” at index and query time.
When the user types in either “lose” or “loose”, search for both.
Example: Avoid grouping many terms as two-way synonyms. A set like program, degree, course, class can make too many queries expand and return noisy results. A one-way mapping such as mba => master of business administration is usually easier to test and control.
Best Practices and Tips
- Examine the list of No Results Searches for inspiration about synonyms. While some words will be good candidates for Synonyms, misspellings are better suited for adding to the Spell Check dictionary.
Troubleshooting and Common Issues
- When you upload a synonym file but no new synonyms appear in the list, check the file format. The upload can fail silently.
- When you enter or upload synonyms and can’t find them later, be sure to Publish your changes.
- Be sure to regenerate your Hosted Search Experience after making any changes.