Documentation
(C) IBM Corp. 1996, 1999

Text Extender: Administration and Programming

SEARCH_RESULT

The SEARCH_RESULT function returns the result of a search in an intermediate table. This UDF can be used in a FROM clause of an SQL statement.

The returned table has the following structure:

            Column Name         Datatype
 
            HANDLE              DB2TX.DB2TEXTH, DB2TX.DB2TEXTFH
            NUMBER_OF_MATCHES   INTEGER
            RANK                DOUBLE

Values are generated only for the selected columns of the intermediate table. Select count(*) generates the HANDLE column only. Because the calculation of the rank values consumes a lot of system resources, you should not select the rank value from the intermediate table if the rank value is not required.

This UDF is faster than CONTAINS or RANK when processing large tables.

Function syntax

>>-SEARCH_RESULT--(--handle--,--search-argument--)-------------><
 

Function parameters

handle
An expression whose result is a value of type DB2TEXTH or DB2TEXTFH. It is usually the name of a handle column containing the handles of the text documents to be searched.

search-argument
A string of type LONG VARCHAR containing the terms to be searched for. See Chapter 10, Syntax of search arguments.

Examples

For an example, refer to Improving search performance, or look at the sample UDFs provided in the file described in The sample UDFs.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]