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 11582 - [FT] Ignoring weight declarations
Summary: [FT] Ignoring weight declarations
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: 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:
Blocks:
 
Reported: 2010-12-21 04:29 UTC by Paul J. Lucas
Modified: 2011-01-07 00:37 UTC (History)
0 users

See Also:


Attachments

Description Paul J. Lucas 2010-12-21 04:29:00 UTC
The XQuery and XPath Full Text 1.0 specification section 2.3.1 says in part:

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

First, I assume that "an FTContainsExpr for which no scores are evaluated" is an FTContainsExpr that does not actually use the "score" keyword, e.g.:

> for $b in /books/book
> where $b/content contains text ("web site" weight {0.5}) ftand ("usability" weight {2})
> return <result>{$b}</result>

In the above query, even though weights are used, no score is requested.  Hence, I assume this is that the specification means by "an FTContainsExpr for which no scores are evaluated."  If this is NOT what the specification means, then the specification should clarify.

Second, for such a query as the above, what does "ignored" mean?  Is the weight declaration ignored in during parsing?  Is it ignored for type-checking?  Is it ignored and not evaluated?

For example, if a weight declaration were "weight { $w }" and $w was not declared anywhere in the query, is that fact ignored or is it an error?

Does "ignored" mean that $w would not even be evaluated?

What if $w is not castable to xs:double: is that fact ignored or is it an error?

What if $w is outside the range [-1000,1000]: is that fact ignored or is it an error?

The specification needs to specify what "ignored" means.
Comment 1 Jim Melton 2011-01-07 00:36:05 UTC
The WG considered your comment and agreed that the text was unclear. We have revised the text to completely remove the Section 2.3.1 statement that "Weight declarations in an FTContainsExpr for which no scores are evaluated are ignored."  We have also added a Note in Section 3.1.1 that states "As a consequence of the flexibility given to implementations under Section 2.3.4 Errors and OptimizationXQ, it is possible that evaluation of weight declarations in an FTContainsExpr for which no scores are evaluated may be skipped by the implementation and errors with them may go unreported."

Because you participated in the discussion and agreed at that time to this wording, we presume that you will mark this bug CLOSED immediately.