Synonyms
Synonyms are aliases - if word A has words B and C listed as synonyms, searching for A will also automatically search for B and C. This is commutative - in our example, querying for B would also be querying for A and C.
At this stage, using the synonyms management requires some editing of the preference files.
In your open-search-server folder, open the data folder, then the folder corresponding to your index, then the config.xml file.
Synonyms management is achieved by entering, for the chosen analyzer, a new filter class, with a name matching the file in which the appropriate synonyms are written. This file is assumed to be in the data folder, though another pathing can be provided.
The synonyms file should always be written on the line following the lower case filter line.
In our example, the French language analyser has been enriched with a file listing synonyms for that language.
The format of a synonym file is simple. Here is an example in English:
test=try, attempt car=automobile, wheels airbag=inflatable cushion, protection, safety elephant=mammoth
Please note that the left side of the equation only accepts single words. Thus, inflatable cushion=airbag is not permissible, whereas the example above is legal.
Furthermore, it is mandatory that, after a synonyms file has been created or modified for one or more analysers, the entire body of data be re-indexed.
So far, so good ? In our example, users querying "search" will also get all the results for a "try" and "attempt" query.
