DB2 Version 10.1 for Linux, UNIX, and Windows

Application migration

The CONTAINS and SCORE functions are used for text search queries in DB2® Text Search and Net Search Extender. Which of the two solutions is used to process the query is determined via the text index characteristics including the activation status. The query language that is used for DB2 Text Search differs syntactically and semantically from Net Search Extender and it is therefore necessary to consider how to manage the query language differences.

The following are the different types of application migration scenarios.

  1. Queries with a single full-text search predicate that has a direct mapping between Net Search Extender and DB2 Text Search

    Add a check on the text index activation status into the application, convert the Net Search Extender syntax into DB2 Text Search syntax, and use the DB2 Text Search syntax when the DB2 Text Search index is active, and the Net Search Extender syntax when the Net Search Extender index is active. The updated application can be deployed independent of the index status. When the DB2 Text Search index is ready for use, switch the activation status. This will automatically activate the new application path. Decoupling application and index migration in this manner will simplify switching the index type as needed.

  2. Queries with multiple full-text search predicates that make use of different text indexes and each predicate has a direct mapping between Net Search Extender and DB2 Text Search

    The basic approach for the application is the same. Add a check on the activation status, convert the syntax and use either the DB2 Text Search syntax or the Net Search Extender syntax depending on the activation status. However, in this case it is required to synchronize switching the activation status for all text indexes that are used in the query.

  3. Queries with at least one full-text search predicate that has no direct mapping between Net Search Extender and DB2 Text Search
    The basic approach starts as described for Scenario 1. However, if there is no corresponding feature in DB2 Text Search that can be used to map the query, two options might be considered.
    • The search feature is available with a different document format. This applies for example, to range search or field search, for which XML type documents provide some options. If this is a critical element, a function may be used to convert the original document into an XML document for text indexing, and then to apply structured queries.
    • Defer migration and contact IBM Support.
Special cases
  1. Structured search

    With Net Search Extender it is necessary to define a document model to apply a section search. DB2 Text Search does implicitly use the XML document structure and enables searches with syntax similar to XPath.

  2. Synonyms or thesaurus

    Synonym dictionaries must be converted from Net Search Extender format to DB2 Text Search format.