Setting Up Synonym Search

You must set up the synonym search and create a custom thesaurus so that the vault users can find documents using synonyms in the search query. If your thesaurus is large, the synonym search can have a negative effect on the performance of the search.

Note: To use this feature, your search engine must be dtSearch.

To set up the synonym search:

  1. Open M-Files Admin and go to a vault.
    1. Open M-Files Admin.
    2. In the left-side tree view, expand a connection to M-Files Server.
    3. In the left-side tree view, expand Document Vaults, and then expand a vault.
  2. In the left-side tree view, select Configurations.
  3. In the gray navigation area, expand Advanced Vault Settings > Configuration, and then select Search.
  4. Open the Advanced tab.
    Result:The search configuration is shown in the JSON format.
  5. In the text editor, under "indexes", find the settings for the index for which you want to enable the synonym search.
  6. Under "additionalOptions", see if the searches field is available.
    If it is not available, enter this to a new row:
    "searches": {
       "useSynonymSearch": true
    }

    If it is available, add only the part in brackets.

  7. Make sure that the values are correctly separated with a comma.
    Example:
    "additionalOptions": {
        "generatedIndexName": "<generated index name>",
        "searches": {
            "useSynonymSearch": true
        }
    },
    You cannot save your changes if the text editor contains invalid JSON.
  8. Click Save.
  9. Open the Configuration tab and expand Indexes > <index identifier> > Additional Options > Searches.
  10. Make sure that you see the setting Use Synonym Search and its value is Yes.
  11. Use a text editor to create your own custom thesaurus file similar to this:
    <?xml version="1.0" encoding="UTF-8" ?>
    <dtSearchUserThesaurus>
    	<Item>
    		<Name>Synonyms for announcement</Name>
    		<Synonyms>announcement notice bulletin statement publication</Synonyms>
    	</Item>
    	<Item>
    		<Name>Synonyms for contract</Name>
    		<Synonyms>contract agreement deal arrangement</Synonyms>
    	</Item>
    </dtSearchUserThesaurus>
    

    Each Item element contains a synonym group.

    Use the Name element to enter a name for the synonym group. The name is used only for identifying the group and it has no effect on search.

    Use the Synonyms element to list the words belonging to a single synonym group. That is, list words that are synonymous of each other. Separate the words with a space.

  12. Save the thesaurus file as thesaur.xml to the following location:
    C:\Program Files\M-Files\<version>\Server\<language code of the search language>
  13. Use Windows Task Manager to restart the MFServer service:
    1. Right-click the taskbar and select Task Manager from the context menu.
      Result:The Task Manager window is opened.
    2. Open the Services tab.
    3. Right-click the MFServer service and select Restart from the context menu.
Now when users search for announcement, the search results list documents containing the words announcement, notice, bulletin, statement, or publication. Synonyms are identified in both document contents and metadata.