Oracle Text Reference
Release 9.0.1

Part Number A90121-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

CONTAINS Query Operators, 4 of 28


ACCUMulate ( , )

Use the ACCUM operator to search for documents that contain at least one occurrence of any of the query terms. The accumulate operator ranks documents according to the total term weight of a document.

Syntax

Syntax  Description 

term1,term2

term1 accum term2 

Returns documents that contain term1 or term2. Ranks documents according to document term weight, with the highest scores assigned to documents that have the highest total term weight. 

Examples

The following example returns documents that contain either soccer, Brazil, or cup and assigns the highest scores to the documents that contain all three terms:

'soccer, Brazil, cup'

The following example also returns documents that contain either soccer, Brazil, or cup. However, the weight operator ensures that documents with Brazil score higher than documents that contain only soccer and cup.

'soccer, Brazil*3, cup'

Notes

Accumulate Scoring

ACCUM scores documents based on two criteria:

Term weight refers to the weight you place on a query term. A query such as x,y,z has term weights of 1 for each term. A query of x, 3*y, z, has term weights of 1, 3, and 1 for the individual terms.

Accumulate scoring guarantees that if a document A matches p terms with a total term weight of m, and document B matches q terms with a total term weight of m+1, document B is guaranteed to have a higher relevance score than document A, regardless of the numbers p and q.

If two documents have the same weight M, the higher relevance score goes to the document with the higher weighted average term score.

This following table illustrates accumulate scoring:

Document  query  Score(x)  Score(y)  Score(z)  Total Term Weight  Score(query) 

x,y,z 

10 

x,y,z 

10 

20 

38 

x,y,z 

10 

20 

30 

73 

x,y,z 

50 

50 

50 

x, y*3, z 

100 

100 

40 

x, y*3, z 

41 

Each row in the table shows the score for an accumulate query. The first four rows show the scores for query x,y,z for documents A, B, C, D. The next two rows show the scores for query x, y*3,z for documents E and F. Assume that x, y and z stand for three different words. The query for document E and F has a weight of 3 on the second query term to arbitrarily make it the most important query term.

The total document term weight is shown for each document. For example, document A has a matching weight of one since only one query term matches the document. Similarly document C has a weight of 3 since all query terms with weight 1 match the document.

The table shows that documents that have higher query term weights are always scored higher than those that contain lower query term weights. For example, document C always scores higher than documents A, B, and D, since document C has the highest query term weight. Similarly, document F scores higher than document E, since F has a higher matching weight.

For documents that have equal term weights, such as document B and D, the higher score goes to the document with the higher weighted average term score, which is document D.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback