Hitachi

Hitachi Advanced Database Setup and Operation Guide


2.17.3 Synonym search

The following describes the synonym search in text (document) data.

Organization of this subsection

(1) Overview of synonym search

When you search literatures, research papers, and other document data for a specific word, you can also search for synonyms of the word at the same time. This function is called synonym search. Before you can perform a synonym search, you must register the target word and its synonyms as a list in a dictionary. This dictionary is called a synonym dictionary. The following figure shows an overview of synonym search.

Figure 2‒60: Overview of synonym search

[Figure]

Explanation
  • Before you can perform a synonym search, you must create a synonym dictionary. In this example, a synonym dictionary named Dictionary1 is created. In the synonym dictionary, database, data bank, and DB are registered as synonyms.

  • You can perform a synonym search by specifying the scalar function CONTAINS in the SELECT statement. For the scalar function CONTAINS, specify the name of the synonym dictionary to be used and one of the synonyms that are registered in the dictionary. In the preceding example, database is specified as one of the synonyms.

  • When the preceding SELECT statement is executed, the synonym search function searches the document data for database, data bank, or DB.

▪ Use in English text search

For search in English text, you can register inflected forms of a word in a synonym dictionary. For example, assume that you register electromagnet, electromagnets, and electromagnetic in a synonym dictionary. If you specify electromagnet as a search string when performing a synonym search, electromagnet, electromagnets, and electromagnetic are all assumed to be search strings.

Example:

SELECT "TITLE" FROM "REPORTS"
    WHERE CONTAINS("DOCUMENTS",'SYNONYM("Dictionary2","electromagnet")')>0
Note

For details about the environment setup and usage of synonym search, see 11.16 Performing synonym search operations.

(2) Combined use with correction search

You can use both synonym search and correction search at the same time. You can specify the scalar function CONTAINS to use both synonym search and correction search.

Example:

SELECT "Document ID" FROM "List of Documents"
    WHERE CONTAINS("Document Data",'SYNONYM("Dictionary1",SORTCODE("database"))')>0

When the preceding SELECT statement is executed, the synonym search function searches the document data for database, data bank, and DB. In addition, the correction search function searches the document data that includes character strings such as DATABASE, Data bank, and db.

(3) Relationship with text indexes

When you perform synonym search, you might be able to improve the search performance by using a text index. Therefore, we recommend that you define a text index for the column that contains the document data to be searched.

Note that if you use a text index when using both synonym search and correction search, you must define a text index that supports correction search. Also note that a text index that supports correction search is larger in size than a text index that does not.