DB2 Text Search is an integrated component of DB2 available starting from V9.5 FP1. It is powered by the IBM OmniFind Text Search server. This tutorial explores the basic DB2 Text Search features to search in plain text and XML documents stored in the database.

DB2 Text Search supports the following document formats.

In this tutorial, you will complete the following steps to discover the power of DB2 Text Search:

  1. Prepare a database for text search.
  2. Create and populate a base table.
  3. Create text indexes for text data and XML documents. Populate the text indexes.
  4. Perform searches in plain text.
  5. Perform searches in XML documents.
  6. Make some changes to the data. Update the text indexes to pick up the changes.
  7. Drop text indexes and disable database for text search if you wish.


Prequisites


On Linux and UNIX operating systems, this command starts a daemon. This daemon controls the scheduling of text search index updates on the DB2 database server. The IBM OmniFind Text Search server is also started and runs as an independent process. the daemon and the IBM OmniFind Text Search server are started under the authorization name of the DB2 instance owner.

On windows operating systems, this command starts the DB2TS service. This service starts the IBM OmniFind Text Search server and henceforth controls the scheduling of text search index updates. The user running the command must meet the Windows requirements for starting the service.

Acknowledgements

This tutorial is based on the article Full-text search with DB2 Text Search . Thanks to Prashant Shettar, Marion Behnen, and Shantanu Mundkur for producing a great article.