it seems to me there is a bug concerning Full Text Search, using option "window":
This query should return all three, $text1, $text2 and $text3, but it only returns $text2 and $text3.
(Italic added by me)
The detailed semantics are given in 4.2.4 FTWords [1]. Pseudo-function fts:applyFtWordsAllWord() constructs for each of the words an fts:allMatches element and then performs conjunction of these elements, based on recursive application of 4.3.6.2 FTAnd [2]. Each fts:allMatches element contains one fts:match element for each occurrence of the word in question. The "ANDing" of two fts:allMatches is described by pseudo-function fts:ApplyFTAnd(), which creates one match for each pair of matches found in the operands - in other words, all combinations of operand matches are considered.
As an example consider:
"foo bar" all words
and assume "foo" occurs two times and "bar" occurs two times. The fts:allMatches element representing the result is the result of applying fts:ApplyFTAnd() to two fts:allMatches elements, one obtained for word "foo", one obtained for word "bar". Schematically:
$fts:allMatches_foo:
<fts:match>foo(1)</fts:match>
<fts:match>foo(2)</fts:match>
$fts:allMatches_bar:
<fts:match>bar(1)</fts:match>
<fts:match>bar(2)</fts:match>
fts:applyFTAnd($fts:allMatches_foo, $fts:allMatches_bar) is a single fts:allMatches containing four matches, each one of which is a combination of matches found in the operands:
<fts:allMatches_allwords> =
<fts:match>foo(1), bar(1)</fts:match>
<fts:match>foo(1), bar(2)</fts:match>
<fts:match>foo(2), bar(1)</fts:match>
<fts:match>foo(2), bar(2)</fts:match>
Now extend the query to
"foo bar" all words window 5 words
The result is true, if there is at least one combination of occurrences of "foo" and "bar" found in a window of at most 5 for word "bar". Referring to the semantic intermediates: if <fts:allMatches_allwords> contains at least one <fts:match> element for which all contained matches satisfy the window condition.