<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>6178</bug_id>
          
          <creation_ts>2008-10-21 22:17:31 +0000</creation_ts>
          <short_desc>[FT] Syntax of the &quot;weight&quot; option</short_desc>
          <delta_ts>2008-11-02 12:48:52 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Full Text 1.0</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xavier Franc">xfranc</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          <cc>pcase</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>22227</commentid>
    <comment_count>0</comment_count>
    <who name="Xavier Franc">xfranc</who>
    <bug_when>2008-10-21 22:17:31 +0000</bug_when>
    <thetext>The weight option is defined by the following production:
[144] FTSelection ::= FTOr FTPosFilter* (&quot;weight&quot; RangeExpr)?

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

   &quot;foo&quot; ftand &quot;bar&quot; weight 2

This is equivalent to: (&quot;foo&quot; ftand &quot;bar&quot;) weight 2
No to:  &quot;foo&quot; ftand (&quot;bar&quot; weight 2)

Now, my feeling is that when writing the 1st expression,
a programmer would probably mean the second form:
         &quot;foo&quot; ftand (&quot;bar&quot; 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:
      (&quot;foo&quot; ftand &quot;bar&quot; weight 2) weight 1

Here both weight options apply to the FtAnd.

Suggestion: 
move the &quot;weight&quot; option to the level of FTPrimaryWithOptions:

[149] FTPrimaryWithOptions ::= FTPrimary FTMatchOptions? (&quot;weight&quot; RangeExpr)?
[144] FTSelection ::= FTOr FTPosFilter*</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22297</commentid>
    <comment_count>1</comment_count>
    <who name="Pat Case">pcase</who>
    <bug_when>2008-10-30 18:04:35 +0000</bug_when>
    <thetext>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? (&quot;weight&quot; 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 </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22298</commentid>
    <comment_count>2</comment_count>
    <who name="Pat Case">pcase</who>
    <bug_when>2008-10-30 18:07:34 +0000</bug_when>
    <thetext>Xavier,

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

Pat Case, Member, Full Text Task Force </thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>