<?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>5886</bug_id>
          
          <creation_ts>2008-07-21 21:12:19 +0000</creation_ts>
          <short_desc>[FT] distance formal semantics is inconsistent with example</short_desc>
          <delta_ts>2008-09-15 18:14:00 +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>Candidate Recommendation</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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="zhen hua liu">zhen.liu</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          <cc>jmdyck</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>21265</commentid>
    <comment_count>0</comment_count>
    <who name="zhen hua liu">zhen.liu</who>
    <bug_when>2008-07-21 21:12:19 +0000</bug_when>
    <thetext>in http://www.w3.org/TR/xpath-full-text-10/#ftdistance, we have 2nd example:

The following expression returns false:

/books/book ftcontains &quot;web&quot; ftand &quot;site&quot; ftand
&quot;usability&quot; distance at most 2 words

The search context does contain the phrase &quot;The usability of a Web site&quot;, in which the tokens &quot;usability&quot; and &quot;Web&quot; have a distance of 2 words, and the tokens &quot;Web&quot; and &quot;site&quot; have a distance of 0 words, both of which satisfy the constraint distance at most 2 words. However, the problem is that &quot;usability&quot; and &quot;site&quot; have a distance of 3 words, which does not satisfy the constraint, and so the distance selection yields no matches, and the expression as a whole yields false. (The phrase &quot;Improving Web Site Usability&quot; would satisfy the given full-text selection, but it occurs in an attribute value, and so is not subject to tokenization.)

This means the distance is applied to every pair of matching tokens.
However, in http://www.w3.org/TR/xpath-full-text-10/#tq-ft-fs-FTDistance, the formal semantic xquery defintion, it applies distance predicate on matching token sorted by their token postion.
Therefore, they are not compared in pairwise manner. For the above example, only &quot;usability&quot; and &quot;web&quot; are compared ; &quot;web&quot; and &quot;site&quot; are compared, but  &quot;usability&quot; and &quot;site&quot; are NOT compared, then the expression in the example shall return true instead of false.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21593</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-08-19 01:58:11 +0000</bug_when>
    <thetext>I have changed the prose around that example to agree with the meeting 170
decision re the application of distance filter to n&gt;2 matches.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21594</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-08-19 02:00:00 +0000</bug_when>
    <thetext>... so I&apos;m marking the bug as resolved-FIXED.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>