W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2010

[FT] ftnot of no matches

From: Paul J. Lucas <paul@lucasmail.org>
Date: Wed, 26 May 2010 17:43:10 -0700
Message-Id: <21D5C032-853D-4F9D-83E4-F0CAC19F92B2@lucasmail.org>
To: public-qt-comments@w3.org
In 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.


	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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:31 UTC