NEAR2

Use the NEAR2 operator to perform position-based scoring and length normalization to help improve relevancy.

The NEAR2 operator divides a document into segments based on the given query. Then, it classifies each segment based on the primary features and scores them based on the secondary features. The primary features that are used are as follows:

The secondary features are as follows:

Syntax

NEAR2((word1, word2,...,wordn),max_span, phrase_weight, partial_phrase_weight, ordered_near_weight, unordered_near_weight, and_weight)

All or none of the weights must be provided. When the weights are provided, the NEAR2 operator works in the weighted-average mode. The weights are integers between 0 and 10.

word1-n

Specify the terms in the query separated by commas. The query terms can be single words or phrases and can use other query operators (see “NEAR with Other Operators”). Only the word list is mandatory.

max_span

Optionally, specify the size of the biggest clump. The default is 50. Oracle Text returns an error if you specify a number greater than 50.

A clump is the smallest group of words in which all query terms occur. All clumps begin and end with a query term.

For near queries with two terms, max_span is the maximum distance allowed between the two terms. For example, to query on dog and cat where dog is within 6 words of cat, enter the following query:

'near((dog, cat), 6)'

phrase_weight

Determine the weight of the phrase primary feature when in weighted-average mode. This is a qualitative weight, which is mapped to an internal weight.

partial_phrase_weight

Determine the weight of the partial phrase primary feature when in weighted-average mode. This is a qualitative weight.

ordered_near_weight

Determine the weight of the ordered near primary feature when in weighted-average mode. This is a qualitative weight.

unordered_near_weight

Determine the weight of the unordered near primary feature when in weighted-average mode. This is a qualitative weight.

and_weight

Determine the weight of the AND primary feature when in weighted average mode. This is a qualitative weight.

Related Topics