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 6178 - [FT] Syntax of the "weight" option
Summary: [FT] Syntax of the "weight" option
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Working drafts
Hardware: PC Linux
: 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: 2008-10-21 22:17 UTC by Xavier Franc
Modified: 2008-11-02 12:48 UTC (History)
1 user (show)

See Also:


Attachments

Description Xavier Franc 2008-10-21 22:17:31 UTC
The weight option is defined by the following production:
[144] FTSelection ::= FTOr FTPosFilter* ("weight" RangeExpr)?

This means that in this expression
the weight applies to the FtAnd expression, not the term "bar":

   "foo" ftand "bar" weight 2

This is equivalent to: ("foo" ftand "bar") weight 2
No to:  "foo" ftand ("bar" weight 2)

Now, my feeling is that when writing the 1st expression,
a programmer would probably mean the second form:
         "foo" ftand ("bar" weight 2)

In other terms, this syntax seems misleading to me.

A related problem is that it is possible to specify
a weight twice on the same expression:
      ("foo" ftand "bar" weight 2) weight 1

Here both weight options apply to the FtAnd.

Suggestion: 
move the "weight" option to the level of FTPrimaryWithOptions:

[149] FTPrimaryWithOptions ::= FTPrimary FTMatchOptions? ("weight" RangeExpr)?
[144] FTSelection ::= FTOr FTPosFilter*
Comment 1 Pat Case 2008-10-30 18:04:35 UTC
Xavier,

The Full Text Task Force at its 10/30/2008 face-to-face meeting agreed to change the grammar for weights as you proposed to:
[149] FTPrimaryWithOptions ::= FTPrimary FTMatchOptions? ("weight" RangeExpr)?
[144] FTSelection ::= FTOr FTPosFilter*

Thank you for making this suggestion.

The change will appear in the next published version of specification.

We also discussed the related problem that you raised -- that it is possible to specify a weight twice on the same expression. Because the effect of weights on the resulting score is implementation-dependent, we decided to leave this detail implement-dependent as well.

Pat Case, Member, Full Text Task Force 
Comment 2 Pat Case 2008-10-30 18:07:34 UTC
Xavier,

If you approve of the response to the bug noted above, please close the bug.

Pat Case, Member, Full Text Task Force