IBM Books
(C) IBM Corp. 2000, 2003.

Net Search Extender

管理和用户指南


使用“SQL 表值函数”来搜索文本

在下列情况下使用“SQL 表值函数”:实现了接口,但是不需要返回所有结果,或者没有使用存储过程接口所需要的所有实际内存。

提供了两个 SQL 表值函数,它们都称为 db2ext.textsearch。一个函数具有与 db2ext.highlight 函数配合使用的附加参数,您可以在没有此函数的情况下使用另一个函数。有关进一步的信息,参见使用 HIGHLIGHT 函数

“SQL 表值函数”提供了与存储过程相同的游标界面来仅获取部分结果。但是,仍然需要将结果与用户表连接起来。可以在以下示例中了解这种情况:

db2 "select docid , author, score from TABLE(db2ext.textsearch('\"book\" ',
     'DB2EXT','COMMENT',3,2,cast(NULL as integer))) as t, db2ext.texttab u
      where u.docid = t.primkey"

下面是一些可能从“SQL 表值函数”返回的值:

--> primKey <single primary key type>
the primary key
 
-->  score         		DOUBLE
the score value of the found document
 
--> NbResults  	   	INTEGER
the total number of found results (same value for all rows)
 
--> numberOfMatches 	INTEGER
the number of hits in the document
注意

注意,只允许存在单个主键列。有关这些参数进一步的详细信息,参见DB2EXT.TEXTSEARCH


[ 页的顶部 | 上一页 | 下一页 | 目录 | 索引 ]