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 12064 - [XQFTTS] FTWindow-paragraphs3
Summary: [XQFTTS] FTWindow-paragraphs3
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Proposed 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: 2011-02-14 14:50 UTC by Tim Mills
Modified: 2011-03-17 08:13 UTC (History)
2 users (show)

See Also:


Attachments

Description Tim Mills 2011-02-14 14:50:49 UTC
The query FTWindow-paragraphs3

let $x := 1 return
$input-context/books/book[content contains text ("heuristic" ftand "experience")
 window $x paragraphs]/metadata/title

expects a single result.  Our implementation returns the empty sequence.

The source document contains 'heuristic' and 'experience' in consecutive paragraphs.  Suppose the paragraphs are numbered 1 and 2.

From the definition of fts:ApplyFTParagraphWindow we have:

 for $match in $allMatches/fts:match
      let $minpos := fn:min($match/fts:stringInclude/fts:tokenInfo/@startPara),
          $maxpos := fn:max($match/fts:stringInclude/fts:tokenInfo/@endPara)
      for $windowStartPos in ($maxpos - $n + 1 to $minpos)
      let $windowEndPos := $windowStartPos + $n - 1
      return ...

Here $n = 1, $minpos = 1, $maxpos = 2 and so we $windowStartPos rnages over 2 to 1.  The range (2 to 1) is the empty sequence, hence no matches should be found.
Comment 1 Tim Mills 2011-02-14 14:54:35 UTC
The test FTWindow-unconstrained-paragraphs3 has an exactly similar problem.
Comment 2 Paul J. Lucas 2011-02-15 03:31:35 UTC
I think there's something wrong with the ApplyFT*Window semantics in general; see:

http://lists.w3.org/Archives/Public/public-qt-comments/2011Feb/0052.html
Comment 3 Michael Dyck 2011-02-21 20:44:40 UTC
(personal response:)

I agree with the analysis in comment #0 (and disagree with comment #3). To fix, we could change the query ('1' to '2') or change the expected result (to empty). Since FTWindow-paragraphs1.xq already tests the 2-paragraph window, it's probably best to keep this query as testing the 1-paragraph window, and so change the expected result to empty.
Comment 4 Michael Dyck 2011-02-21 20:45:34 UTC
(oops, where I said "comment #3", I meant "comment #2".)
Comment 5 Michael Dyck 2011-03-15 22:20:52 UTC
At their joint meeting on 2011-02-28, the WGs agreed that the 2 test cases FTWindow-paragraphs3 and FTWindow-unconstrained-paragraphs3 are broken, and directed me to fix them as described in comment 3 (i.e., change the expected results to match the query, rather than vice versa).

So I have now replaced the file
    ExpectedTestResults/.../FTWindow-paragraphs3.xml
with an empty file:
    ExpectedTestResults/.../FTWindow-paragraphs3.txt

and in the catalog, in test-cases:
    FTWindow-paragraphs3 and
    FTWindow-unconstrained-paragraphs3
changed
    <output-file ... compare="XML">FTWindow-paragraphs3.xml</output-file>
to
    <output-file ... compare="Text">FTWindow-paragraphs3.txt</output-file>

Consequently, I'm marking this bug resolved-fixed. Please mark it closed if you accept this resolution.
Comment 6 Tim Mills 2011-03-17 08:13:53 UTC
Confirmed fixed.  Thanks.