- Synonym types
- Multiword synonyms
- Synonyms Editor API
- Using the synonyms editor
Synonyms are words that mean the same thing, within the context where they are used. Used for search, synonym expansion allows Fusion to return results that match the meaning of the query terms, but not the words themselves. Synonyms are important for mapping query terms such as acronyms to their names, jargon to public terms, misspellings to correct spellings, old to new personal or corporate names, and otherwise bridging the gap between the user vocabulary and terms in the original text.
Fusion uses the Solr
synonyms.txt and Solr collections, which are managed by Fusion.
Solr itself manages a set of resources to apply synonym expansion, with configuration through the Fusion API and the Fusion UI.
However, Fusion synonyms are not interchangeable with Solr synonyms files.
There are three kinds of search synonyms, depending on the requirements of the search for each specific term.
Replacements are used to change the query, to replace it with a more standard term or terms. For example:
lucid => lucidworks
In this case, "lucid" by itself not an approved term, so there should be no instances where the company name is a partial word.
One-way expansion synonyms
Oneway expansions expand original terms with more standard terms while retaining the original term; they do not do the opposite, expand standard terms to the original non-standard terms
monitor => monitor, display
In this case, "display" is the standard term, but "monitor" is used in some older user-generated content.
Multi-way expansion synonyms
Where each term is considered equally standard, multiway synonyms expand the query so any items with any of the terms is retrieved.
This example shows terms that are used interchangeably by authors. For this search engine, there is no need to distinguish among them, and considerable value in increasing recall to find all items discussing this topic, however other content stores may use them differently. Note that "logging" and "signing" have specific meanings in many contexts, so they might not be candidates for synonyms.
Example of synonym expansion:
|Results before synonyms||Results after synonyms|
Viewing the query using the debug=true parameter shows how it is expanded:
"querystring": "logon", "parsedquery": "(+DisjunctionMaxQuery((Synonym(_text_:login _text_:logon _text_:signin _text_:signon))))/no_coord", "parsedquery_toString": "+(Synonym(_text_:login _text_:logon _text_:signin _text_:signon))",
Lucene/Solr supports multiword synonyms in version 6.6 and later, and Fusion in version 3.1 and later. There are significant technical complexities in performing graphed phrased expansion that had to be overcome.
To enable multiword synonyms in Fusion, create an Additional Parameter stage for disabling the split on whitespace tokenization process (which applies to synonyms only):
Using EDismax, this allows the new Solr SynonymGraphFilter to create the graph representations of token streams containing overlapping synonyms of varying word counts, and expand the queries with additional terms.
appstudio => app studio signup =>signup,sign up login,log in,logon,log on,signin,sign in,signon,sign on
Multiword synonyms work just like single-word synonyms, expanding the parsed query with additional query terms. For Solr details, see: Multi-Word Synonyms: Solr Adds Query-Time Support.
Synonyms Editor API
The Synonyms Editor API provides complete REST access to all aspects of the synonyms.
Using the synonyms editor
The Fusion UI provides an interactive synonyms management tool. From the App menu on the left, click COLLECTIONS > Synonyms. Once opened, the Synonyms Manager panel displays the
synonyms.txt as a series of editable fields, one per line.
To edit the synonym list:
Click the empty field at the bottom of the list.
Enter a new synonym.
To create a two-way mapping, in the Mapping column, separate terms with commas.
To create a one-way mapping, in the Mapping column, separate terms with
=>, or click the arrow button in the Type column.
Move the cursor out of the editor field to add the item.
Click Save in the upper right to keep changes and apply these synonyms to the current collection immediately.
|As you change synonym settings, the upper right notification says "Synonyms entry updated". However, the changes do not take effect until you click Save.|
Other actions on the Synonyms Manager page include the following:
Enter labels in the Category field to identify and group rules (Fusion synonyms only).
The "Export" button downloads a CSV file of the synonyms list using your browser’s download capability.
The "Import and Save" button lets you import a local CSV file into Fusion.