[FT] ftnot of no matches

In 4.2.6.3 of the XQuery Full Text spec, the semantics seem clear enough.  However, what's not clear is how ftnot works when there are no matches to begin with.

Given:

	let $x := <msg>hello, world</msg>
	return $x contains text ftnot "goodbye"

It's clear that the XML document does not contain "goodbye".  Hence, the matchTokenInfos() function will return no TokenInfo objects and, subsequently, applyQueryTokensAsPhrase() will return an empty <allMatches/>.

Calling ApplyFTUnaryNot() on <allMatches/> will do nothing since there are no stringIncludes to flip to stringExcludes and vice versa.  Therefore, the XQuery above will return false.

However, intuitively, the result of the XQuery above should be true since the document does not contain "goodbye".

Is "false" the correct answer?  If not, then how, given the semantics as they are, would "true" be returned?

- Paul

Received on Thursday, 27 May 2010 00:43:46 UTC