How do I enable synonyms for a collection in SearchBlox?

Using synonyms in search helps identify relevant documents related to the search term, even if the search term is not available directly in the indexed documents. For example, while searching for files using the term “global”, files with the terms “world” and “international” (synonyms) could also match the criteria and will be listed in the search results. SearchBlox has implemented synonym search in a customized way where the user can specify search terms with synonyms. 

You can add synonyms under the collection settings. Go to Collection -> Synonyms tab. Add synonyms as required and click Save. The collection has to be indexed after saving for the synonyms to take effect (if already indexed, then clear and re-index). 

Synonyms can be given in different ways:

  1. Simple comma-separated synonyms

    For example: world, global, international, intercontinental. When the user searches for "world", "global", "international" or "intercontinental", documents containing any of these words will appear in search results. If the user searches "intercontinental", the results will include documents with "world", "global", and "international", as well as "intercontinental". Searching for other synonyms will also lead to same scenario.

  2. Explicit mappings

    Explicit mappings use the symbol "=>" which tells SearchBlox how the words are to be replaced while indexing. Explicit mappings could be of two types:


    1. Synonyms that represents Expand = true 
      For example:
       world, global, international, intercontinental =>  world, global, international, intercontinental
      or
      world =>  global, international, intercontinental

      SearchBlox will replace the occurrences of “world” with “global”, “international” or “intercontinental”. Note that in the second example, only occurrences of “world” will be mapped, the words “global”, “international” and “intercontinental” will not be replaced and the results will be as usual for these words. Searching for global will give results for global as well as world.

    2. Synonyms that represents Expand = false 
      For example:
      global, international, intercontinental =>  world

      SearchBlox will replace the occurrences of “world”, “global”, “international” and “intercontinental” with “world”. Note: With this type of mapping, searching for “world” will yield documents with all the words (global, international and intercontinental) where the mapping is done. Searching for “global” will yield results for all words similar to that of simple mapping.

Have more questions? Submit a request

Comments