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 5886 - [FT] distance formal semantics is inconsistent with example
Summary: [FT] distance formal semantics is inconsistent with example
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
Depends on:
Reported: 2008-07-21 21:12 UTC by zhen hua liu
Modified: 2008-09-15 18:14 UTC (History)
1 user (show)

See Also:


Description zhen hua liu 2008-07-21 21:12:19 UTC
in, we have 2nd example:

The following expression returns false:

/books/book ftcontains "web" ftand "site" ftand
"usability" distance at most 2 words

The search context does contain the phrase "The usability of a Web site", in which the tokens "usability" and "Web" have a distance of 2 words, and the tokens "Web" and "site" have a distance of 0 words, both of which satisfy the constraint distance at most 2 words. However, the problem is that "usability" and "site" 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 "Improving Web Site Usability" 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, 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 "usability" and "web" are compared ; "web" and "site" are compared, but  "usability" and "site" are NOT compared, then the expression in the example shall return true instead of false.
Comment 1 Michael Dyck 2008-08-19 01:58:11 UTC
I have changed the prose around that example to agree with the meeting 170
decision re the application of distance filter to n>2 matches.
Comment 2 Michael Dyck 2008-08-19 02:00:00 UTC
... so I'm marking the bug as resolved-FIXED.