Using Synonyms

Introduction

With Squirro release 3.1.0, users can now use the power of synonyms over Frontend to make their search experience even more powerful. New additions with this release include:

  • Ability to configure different synonyms lists for different facets over Frontend. This feature was available as an API only feature in the past.

  • Ability to configure and apply synonyms to the main content of the items, i.e. – title, body and summary fields of Squirro Items. Usage of synonyms lists over for the main content of the items is a new feature and is available only post release 3.1.0

Setup

Setup for content fields

  • The management screen for different synonym lists is visible under the “Explore” tab of the Squirro application

  • Post updating or installing to Squirro release 3.1.0, all the newly created projects will come with a default synonyms list named “Synonyms for Title, Body & Abstract” pre-configured for that project. Please take extra note that only the newly created projects will have this synonyms list configured.

  • Click on the “Edit” button (upon hover) for the synonyms list mentioned above. This will allow you to populate your synonyms list with the relevant synonyms for your project as shown below

  • You can either specify all the synonyms list in the “Synonyms List” input text box, with one synonyms list per line or you can drag and drop a synonyms file in the same format as explained above to the drag & drop zone to automatically fill the text field.

  • The syntax of the synonyms file follow the Solr Synonyms Syntax. A brief description of the Solr format is show below from the Elasticsearch docs

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 # Blank lines and lines starting with pound are comments. # Explicit mappings match any token sequence on the LHS of "=>" # and replace with all alternatives on the RHS. These types of mappings # ignore the expand parameter in the schema. # Examples: i-pod, i pod => ipod, sea biscuit, sea biscit => seabiscuit # Equivalent synonyms may be separated with commas and give # no explicit mapping. In this case the mapping behavior will # be taken from the expand parameter in the schema. This allows # the same synonym file to be used in different synonym handling strategies. # Examples: ipod, i-pod, i pod foozball , foosball universe , cosmos lol, laughing out loud # If expand==true, "ipod, i-pod, i pod" is equivalent # to the explicit mapping: ipod, i-pod, i pod => ipod, i-pod, i pod # If expand==false, "ipod, i-pod, i pod" is equivalent # to the explicit mapping: ipod, i-pod, i pod => ipod # Multiple synonym mapping entries are merged. foo => foo bar foo => baz # is equivalent to foo => foo bar, baz
  • Squirro supports the full synonyms syntax including multi-word synonyms and contractions.

  • After configuring the synonyms list, please click on the “Update” button

  • The linking from this default synonyms lists to the content of Squirro items is automatic and is setup during the project creation time. This linking can not be changed/updated in the first release.

Set up on Facets

  • For configuring a synonyms list to be used on a certain facet, please head over to the Synonyms management page under the Explore tab and click on the plus button as shown below

  • This will open the Edit Synonyms list modal.

  • Please give your synonyms list an identifiable name and populate the “Synonyms List” dialog in the similar fashion as mentioned in the section above.

  • Having configured a synonyms list, you can explicitly map/un-map it to a particular facet by heading over to the facets management screen (above the synonyms management screen) and editing a facet as shown below

  • After selecting a specific synonyms list from the drop-down menu for a facet, please click on the “Update” button.

  • From here on, this synonyms list will by default be used for searching on this particular facet

  • Please note that, the synonyms list mapping is only available for “string” type synonyms and is not available for other types of facets (like bool, int, float)

Search using synonyms

For enabling the synonyms search on the content (title, body & summary fields) of Squirro items, please populate the default synonyms list “Synonyms for Title, Body & Abstract” as described above. From here on, the synonyms search will be available by default on these fields.

Similarly, for enabling the search on a specific facet using a Squirro Synonyms, please follow the “Setup on Facets” section above. From there on, the synonyms search will be available for the configured facet.

Deletion of Synonyms Lists

Synonyms lists can be deleted using the delete button on the synonyms list management screen as shown below

Please note that we will not allow deletion of synonyms list which are currently in use by a facet or by the Squirro content fields. In order to delete such synonyms, you will first have to un-map them from the corresponding facet (in the facet edit menu) before proceeding to delete such synonyms list.