Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

DB2 Text Search, Part 1: Full text search

Prashant Shettar (pshettar@in.ibm.com), System Software Engineer, IBM
Prashant Shettar is a Systems Software Engineer at IBM’s Information Management Group (part of IBM Software Group) in Bangalore, India.
Marion Behnen (mbehnen@us.ibm.com), DB2 Text Search Development, IBM
Marion Behnen is a Senior Software Engineer within the IBM Software Group and works as a technical lead for full-text search in DB2. She has more than 20 years of experience with database application development, business reporting, data warehousing, and business process integration. Prior to joining IBM, she was involved with many aspects of business process and data integration, in particular for the manufacturing industry.
Shantanu Mundkur (mundkur@us.ibm.com), DB2 Text Search Development, IBM
Shantanu Mundkur is an Advisory Software Engineer at IBM's Silicon Valley Laboratory. He is part of the IBM DB2 for Linux, UNIX and, Windows development team and works in the area of full-text search. He has a broad range of software product development experience, and has designed and implemented features for various database servers including DB2 and Informix.

Summary:  DB2 Text Search enables an IBM DB2 for Linux, UNIX, and Windows database user to create applications with full text-search capabilities by embedding full text-search clauses in SQL and XQuery statements. In this tutorial, you'll set up a database to support text search, and walk through a scenario to get some experience for setting up your own text searches.

Note: This tutorial has been updated to better present examples and code commands to help prevent users less familiar with DB2 from encountering problems.

View more content in this series

Date:  15 Apr 2010 (Published 16 Oct 2008)
Level:  Introductory PDF:  A4 and Letter (250 KB | 15 pages)Get Adobe® Reader®

Activity:  51502 views
Comments:  

Before you start

Learn what to expect from this tutorial, and how to get the most out of it.

About this tutorial

DB2 Text Search is an integrated component of DB2 9.5 and is powered by the IBM OmniFind™ Text Search server. It provides the following features:


  • Full text search in text, HTML, and XML documents, including Boolean and wildcard search
  • Fully integrated SQL, SQL/XML, and XQuery support, including XPath syntax subset to search XML documents
  • Linguistic processing with optional synonyms definition
  • Asynchronous index update with scheduling option

This tutorial demonstrates how to use the basic features of DB2 Text Search to search in plain text and XML documents stored in the database and guides you through the following tasks:

  • Preparing the database setup
  • Creating text-search indices for text data and XML documents
  • Populating text-search indices
  • Searching in plain text
  • Determining the relevance of results
  • Searching in XML documents
  • Updating text-search indices
  • Cleaning up

System requirements and prerequisites

To complete the following steps, you must have at least IBM DB2 9.5 for Linux, UNIX, and Windows, Fix Pack 1 installed on the system. Note that you cannot use DB2 Text Search in a partitioned database environment on a DB2 instance with multiple partitions.

To proceed through the tutorial using a step-by-step approach, the commands can be executed as DB2 CLP interactive commands using the db2 -t command. The db2ts text-search index administration commands have to be run at the operating system prompt. However, these commands can be executed in the same window by using the shell command (!). In this mode, every statement would also have to use the statement termination character—a semicolon (;).

To run the examples in this article, make sure that you have DBADM authority on the DB2 database server that you want to use. If you create the database as described in the next section, this authority is automatically assigned. The DBADM authority is needed to manage the text-search instance services and to create and modify the database used in the examples.

1 of 10 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management
ArticleID=482473
TutorialTitle=DB2 Text Search, Part 1: Full text search
publish-date=04152010
author1-email=pshettar@in.ibm.com
author1-email-cc=
author2-email=mbehnen@us.ibm.com
author2-email-cc=
author3-email=mundkur@us.ibm.com
author3-email-cc=