This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3905 - [FT] Allow negative weights
Summary: [FT] Allow negative weights
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on: 3743
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-31 22:31 UTC by Mary Holstege
Modified: 2007-01-04 19:53 UTC (History)
0 users

See Also:


Attachments

Description Mary Holstege 2006-10-31 22:31:01 UTC
Allow for weights to be negative.
Comment 1 Jim Melton 2007-01-04 19:51:34 UTC
There is a new conformance subsection and the addition of the words "absolute value" in section 2.3.1 bullet 3 and a small cleanup to make the bullets consistent

----
2.3.1 Using Weights Within a Scored FTContainsExpr

[Definition: Scoring may be influenced by adding weight declarations to search tokens, phrases, and expressions.] Syntactically weight declarations are introduced in the FTSelection production, described in FTSelections.

    for $b in /books/book
    let score $s := $b/content ftcontains ("web site" weight 0.2)
                                       && ("usability" weight 0.8)
    return <result score="{$s}">{$b}</result>

The effect of weights on the result score is implementation-dependent. However, weight declarations must follow all these rules:

1. Weights in an FTContainsExpr are significant only in relation to each other.
2. When no explicit weight is specified, the default weight is 1.0.
3. The weight must have an absolute value between 0.0 and 1000.0 inclusive.

Weight declarations in an FTContainsExpr for which no scores are evaluated are ignored.

---

(New) 5.2.14 Weights

An implementation may constrain the range of valid weights to non-negative values. If an implementation does enforce this restriction and encounters a full-text query that used a negative weight, it MUST raise an error [err:XXXTBD].
Comment 2 Jim Melton 2007-01-04 19:53:30 UTC
Because you were present when the decision was made to resolve this bug, and (indeed) you wrote the changes, we presume that you accept the resolution and are thus closing the bug.