This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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.
The test FTWindow-unconstrained-paragraphs3 has an exactly similar problem.
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
(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.
(oops, where I said "comment #3", I meant "comment #2".)
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.
Confirmed fixed. Thanks.