Open topic with navigation

# Enable Synonym Searches

Use the following procedure to enable synonym searches in HPE IDOL Server.

To enable synonym searches

1. Set up a synonym file.

2. Configure HPE IDOL Server to use a synonym file.

3. Perform a synonym query.

For details on the settings that the `[Synonym]` sections can contain and on how you can configure them, see the HPE IDOL Server Reference.

Related Topics

- Display Online Help

- Set up a Synonym File

- Configure HPE IDOL Server to Use a Synonym File

- Perform Synonym Searches

## Set up a Synonym File

Note: You must set up a synonym file before you index the data that you want to search.

To set up a synonym file

1. Create a text file and save it in the HPE IDOL Server `IDOL/content` directory, using the file name that you specified in the `[SynonymType]` section of the HPE IDOL Server configuration file.

2. Create a section for each language. The section name must be the name of a valid language type configured in HPE IDOL Server (that is, a language and encoding).

   Note: You do not need to create a section for each encoding in the same language. HPE IDOL Server uses the same synonyms for this language, in all encodings. For example, if you add an `[EnglishUTF8]` section, you do not also need to add an `[EnglishASCII]` section.

   For example:

       [EnglishUTF8]
       [GermanUTF8]

3. In each section, create a line for each word for which you want to list synonyms. Use the same encoding that you specified in the section name. For example:

       [EnglishUTF8]
       cat
       dog

       [GermanUTF8]
       Katze
       Hund

4. List synonym strings next to each word and save the file. You must separate the word and each string with commas. There must be no space before or after a comma. The individual terms can contain spaces but must not contain any punctuation. For example:

       [EnglishUTF8]
       cat,feline,grimalkin,moggy,mouser,puss,tabby
       dog,cur,hound,mans best friend,mongrel,mutt,pooch,puppy

       [GermanUTF8]
       Katze,Mietze,Mietzekatze,Mietzekater,Kater,Mulle,Kätzchen
       Hund,Wau Wau,Hündin,Töle,Kläffer,Hündchen,Welpe

   Note: For Asian languages, you can also use Asian byte-order marks.

Related Topics

- Configure HPE IDOL Server to Use a Synonym File

## Configure HPE IDOL Server to Use a Synonym File

Note: You must configure HPE IDOL Server to use the synonym file before you index the data that you want to search.

To configure HPE IDOL Server to use a synonym file

1. Open the HPE IDOL Server configuration file in a text editor.

2. In the `[FieldProcessing]` section of the HPE IDOL Server configuration file, set up a synonym process. This process allows HPE IDOL Server to determine when it must apply synonym settings. For example:

       [FieldProcessing]
       0=SynonymMatch

3. Create a section for the synonym process you listed, in which you create a property for the process (synonym properties always point to a defined synonym job). Identify the fields that you want to associate with the process. For example:

       [SynonymMatch]
       Property=ApplySynonymMatch
       PropertyFieldCSVs=*/DRETITLE,*/DRECONTENT

   In this example, HPE IDOL Server returns documents for synonym queries only if their `DRETITLE` or `DRECONTENT` field values match the query.

   Note: The property that you create must not have the same name as the process.

   To identify the fields, use the format `/FieldName` to match root-level fields, `*/FieldName` to match all fields except root-level, or `/Path/FieldName` to match fields that the specified path points to.

4. Create a section for the property in which you set the `SynonymType` parameter to the name of the synonym job that specifies which settings HPE IDOL Server must apply to synonym queries.

       [ApplySynonymMatch]
       SynonymType=Synonym_job

5. In the `[Synonym]` section of the HPE IDOL Server configuration file, list the synonym job whose settings you want to apply when you send a synonym query to HPE IDOL Server. You can set up multiple jobs. However, you normally require only one. For example:

       [Synonym]
       0=Synonym_job

6. Define a section for your synonym job in which you specify the settings that you want to apply to synonym queries. The section must have the same name as the synonym job. For example:

       [Synonym_job]
       File=animals.txt
       MaxExpandLevel=1

7. Save and close the configuration file. Restart HPE IDOL Server for your changes to take effect.

## Perform Synonym Searches

After you create a synonym file and configure HPE IDOL Server to use it, you can turn any `Query` action that you send to HPE IDOL Server into a synonym query by adding `&Synonym=True` to it. For example:

    http://localhost:5552/action=Query&Text=Felix is a great mouser&Synonym=True

This query returns documents that conceptually match the term mouser, as well as documents that conceptually match any of the terms listed as synonyms for the term mouser in the synonym file.

## Update Synonym Files

HPE IDOL Server processes synonyms at index time. When you want to update or add a synonym in your synonym file, you must reindex your content for the modified synonyms to be available over all content. If you do not reindex, the synonym changes apply only to new documents.

© 2016 Hewlett Packard Enterprise Development LP | Send documentation feedback to HPE Close Send Documentation Feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to AutonomyTPFeedback@hpe.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_HP_HTML5_bannerTitle.htm