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 6813 - empty string full-text query
Summary: empty string full-text query
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Proposed Recommendation
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: http://www.w3.org/TR/xpath-full-text-10/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-15 09:11 UTC by Petr Pleshachkov
Modified: 2011-01-06 15:46 UTC (History)
1 user (show)

See Also:


Attachments

Description Petr Pleshachkov 2009-04-15 09:11:40 UTC
Dear authors,

In the spec. you say that token is a none-empty string of characters. But if 
I have the following query : <p>petr</p>[. ftcontains ""] What is the result of this query ? 

And what is the result for this query <p>petr </p>[. ftcontains "petr" ftand ""]

Kind regards,
Petr
Comment 1 Michael Dyck 2009-06-07 03:44:48 UTC
We have added wording to section 3.2 "Search Tokens and Phrases" to
clarify various edge cases, including these.

In both queries, the StringLiteral "" is an FTWordsValue, which
evaluates to a single xs:string value, namely the empty string, which
is then tokenized, presumably into an empty sequence of tokens.
The associated FTAnyallOption is omitted, which is equivalent to 'any'.
The relevant wording is now:
    If FTAnyallOption is "any", the sequence of tokens for
    each string is considered as a phrase. If the sequence
    of tokens is empty, then the phrase contributes nothing
    to the set of matches for the FTWords.
So the empty string (with its empty sequence of tokens) contributes no
matches, and there are no other strings in the value of the FTWordsValue,
so the whole FTWords yields no matches. Propagating up from there, the
FTContainsExpr yields false, so the query yields the empty sequence.

We believe that the indicated wording change resolves this issue, so
I am marking it resolved-FIXED. If you agree, please mark it CLOSED.