Open topic with navigation
To enable synonym lists, you must create a synonym file, and configure the IDOL Content component to use it.
When you configure a synonym list, Content uses it at index time to locate the synonyms, and it applies the synonyms at query time, when you use the
Synonym lists might be useful if you want to use synonym matching for a small number of terms (100 or less). For longer lists of synonyms, it might affect the performance of indexing and query, and HPE recommends that you use Query Manipulation Server instead.
You must set up the synonym file before you index the data that you want to search.
The following sections describe how to set up and configure Content to use the synonym file:
The synonym file contains the synonyms that you want to apply in your queries.
Create a text file and save it in the IDOL Content component
Create a section for each language. The section name must be the name of a valid language type configured in the IDOL Content component (that is, a language and encoding).
You do not need to create a section for each encoding in the same language. Content 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
In each section, create a line for each list of synonyms. Use the same encoding that you specified in the section name. Content identifies all terms on the same line as synonyms. Separate each synonym term with commas. The individual synonym terms can contain spaces, but must not contain any punctuation.
[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
Save the synonym file.
To configure Content to use a synonym file, you must configure a field process to specify the fields that you want to apply the synonym processing to. For these fields, Content processes and stores synonym information when you index documents, and retrieves the synonym information for synonym queries.
You must also configure the synonym job, which defines the location of the synonym file to use.
Open the IDOL Content component configuration file in a text editor.
[FieldProcessing] section of the IDOL Content component configuration file, set up a synonym process. This process allows Content to determine the fields to which it must apply synonym settings. For example:
Create a section for the synonym process you listed.
Property to the name of the property configuration section for the process. The property that you create must not have the same name as the process.
PropertyFieldCSVs to the list of fields that you want to associate with the process. These fields must also be configured as
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.
[SynonymMatch] Property=ApplySynonymMatch PropertyFieldCSVs=*/DRETITLE,*/DRECONTENT
In this example, Content processes synonyms for terms that occur in the
DRECONTENT fields. When you run a synonym search, Content searches for the query terms and their synonyms in these fields.
[Synonym] section of the IDOL Content component configuration file, or create one if it does not exist. In this section, list the name of the synonym job you want to create. You can set up multiple jobs. However, you normally require only one. For example:
Create a configuration section with the name of the synonym job.
In this section, set
File to the name of the text file that defines your synonym lists (see Create a Synonym File).
Set any other synonym settings that you want to use for this synonym job. For more information about the available settings, see the IDOL Server Reference. For example:
[Synonym_job] File=animals.txt MaxExpandLevel=1
Save and close the configuration file.
Restart the IDOL Content component for your changes to take effect.
After you create a synonym file and configure Content to use it, you can index your content. During the index process, Content processes the synonym rules and stores information about the synonyms in your index.
To run a synonym search, you send a
Query action with the
Synonym parameter set to
True. For example:
http://localhost:5552/action=Query&Text=Felix is a great mouser&Synonym=True
This query returns documents that match the term mouser, as well as documents that match any of the terms configured as synonyms for the term mouser.
Content identifies and searches for synonyms only in the configured synonym fields. For any index fields that you do not define as synonym fields, Content searches only for the exact query terms.
Synonym queries return synonym links, which indicate internally the set of terms and phrases that a synonym corresponds to. You can use the
TermExpand action, with the
Expansion parameter set to
Synonym, to expand these internal links to see what these term phrases are.
Content 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.