Oracle8i interMedia Text Reference
Release 2 (8.1.6)

A77063-01

Library

Product

Contents

Index

Prev Up Next

SQL Commands, 6 of 6


SCORE

Use the SCORE operator in a SELECT statement to return the score values produced by CONTAINS in a Text query.

Syntax

SCORE(label NUMBER)

label

Specify a number to identify the score produced by the query.

Notes

The SCORE operator can be used in a SELECT, ORDER BY, or GROUP BY clause.

Example

Assume that a news database stores and indexes the title and body of news articles separately. The following query returns all the documents that include the words Oracle in their title and java in their body. The articles are sorted by the scores for the first CONTAINS (Oracle) and then by the scores for the second CONTAINS (java).

SELECT title, body, SCORE(10), SCORE(20)
FROM news
WHERE CONTAINS (news.title, 'Oracle', 10) > 0 OR
      CONTAINS (news.body, 'java', 20) > 0 
ORDER BY NVL(SCORE(10),0), NVL(SCORE(20),0);

Related Topics

CONTAINS

Appendix G, "Scoring Algorithm"


Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index