Use the following procedure to enable synonym searches in IDOL Server.
Set up a synonym file.
Configure IDOL Server to use a synonym file.
Perform a synonym query.
For details on the settings that the [Synonym]
sections can contain and on how you can configure them, see the IDOL Server Reference.
Note: You must set up a synonym file before you index the data that you want to search.
Create a text file and save it in the IDOL Server IDOL/content
directory, using the file name that you specified in the [SynonymType]
section of the IDOL Server configuration file.
Create a section for each language. The section name must be the name of a valid language type configured in IDOL Server (that is, a language and encoding).
Note: You do not need to create a section for each encoding in the same language. 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]
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
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.
Note: You must configure IDOL Server to use the synonym file before you index the data that you want to search.
Open the IDOL Server configuration file in a text editor.
In the [FieldProcessing]
section of the IDOL Server configuration file, set up a synonym process. This process allows IDOL Server to determine when it must apply synonym settings. For example:
[FieldProcessing] 0=SynonymMatch
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, 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.
Create a section for the property in which you set the SynonymType
parameter to the name of the synonym job that specifies which settings IDOL Server must apply to synonym queries.
[ApplySynonymMatch] SynonymType=Synonym_job
In the [Synonym]
section of the IDOL Server configuration file, list the synonym job whose settings you want to apply when you send a synonym query to IDOL Server. You can set up multiple jobs. However, you normally require only one. For example:
[Synonym] 0=Synonym_job
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
Save and close the configuration file. Restart IDOL Server for your changes to take effect.
After you create a synonym file and configure IDOL Server to use it, you can turn any Query
action that you send to 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.
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.
|