To enable synonym lists, you must create a synonym file, and configure HPE IDOL Server to use it.
When you configure a synonym list, HPE IDOL Server uses it at index time to locate the synonyms, and it applies the synonyms at query time, when you use the Synonym
parameter.
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 HPE IDOL Server 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 HPE IDOL Server IDOL/content
directory.
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).
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]
In each section, create a line for each list of synonyms. Use the same encoding that you specified in the section name. HPE IDOL Server 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.
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
Save the synonym file.
To configure HPE IDOL Server 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, HPE IDOL Server 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 HPE IDOL Server configuration file in a text editor.
In the [FieldProcessing]
section of the HPE IDOL Server configuration file, set up a synonym process. This process allows HPE IDOL Server to determine the fields to which it must apply synonym settings. For example:
[FieldProcessing] 0=SynonymMatch
Create a section for the synonym process you listed.
Set 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.
Set PropertyFieldCSVs
to the list of fields that you want to associate with the process. These fields must also be configured as Index
fields.
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.
For example:
[SynonymMatch] Property=ApplySynonymMatch PropertyFieldCSVs=*/DRETITLE,*/DRECONTENT
In this example, HPE IDOL Server processes synonyms for terms that occur in the DRETITLE
and DRECONTENT
fields. When you run a synonym search, HPE IDOL Server searches for the query terms and their synonyms in these fields.
Create a section for the property. In this section, set SynonymType
to the name of the synonym job that you want to apply to these fields.
[ApplySynonymMatch] SynonymType=Synonym_job
Find the [Synonym]
section of the HPE IDOL Server 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:
[Synonym] 0=Synonym_job
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).
For example:
[Synonym_job] File=animals.txt
Set any other synonym settings that you want to use for this synonym job. For more information about the available settings, see the HPE IDOL Server Reference. For example:
[Synonym_job] File=animals.txt MaxExpandLevel=1
Save and close the configuration file. Restart HPE IDOL Server for your changes to take effect.
After you create a synonym file and configure HPE IDOL Server to use it, you can index your content. During the index process, HPE IDOL Server 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.
HPE IDOL Server identifies and searches for synonyms only in the configured synonym fields. For any index fields that you do not define as synonym fields, HPE IDOL Server 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.
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.
|