IBM Books
(C) IBM Corp. 2000

DB2 Net Search Extender Administration and User's Guide

Searching and returning the score of a found text document

SCORE is an absolute value that indicates how well the document meets the search value relative to other found documents. The value indicates the number of matches that are found in the document in relation to the document's size. In the following example, you can get the score of a found document by using the SCORE function:

WITH TEMPTABLE(docid,score)
        AS (SELECT docid,
                   SCORE(COMMENT,'"book"')
        FROM DB2EXT.TEXTTAB)
SELECT *
        FROM TEMPTABLE
        WHERE score > 0  
        ORDER BY score ASC

SCORE returns a DOUBLE value between 0 and 1.

Note

You cannot use the CONTAINS, SCORE, and NUMBEROFMATCHES search functions for indexes created on views.

In a distributed DB2 environment, the SCORE values are different:

  • In a non-distributed environment, all the documents are in a single table. The SCORE value is based on a single table, and the documents relationship to all the other documents in the table.
  • In a distributed DB2 environment, all the documents are located on different nodes. During indexing, only the local documents are used to build the text indexes, which are local on every node. In this case, the SCORE value is based on the documents relationship to all documents in only one of the multiple nodes.


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