Search for word tokens in a search string.
ft:text-contains(node $node, string $searchString) => boolean
This text retrieval function searches a node for a sequence of one or
more word tokens (passed as a string). It returns true
if all word
tokens appear exactly in the order as specified in
$searchString
.
With ft:text-contains
you can perform search operations
including the use of a wildcard character. The section
Pattern
Matching in the XQuery 4 User Guide
explains this in detail.
This function is bound to the namespace http://www.w3.org/2002/04/xquery-operators-text and you need to declare that namespace in the query prolog.
Note:
This function is deprecated and will be removed in future versions of
Tamino. You should use the function tf:containsText
instead.
See the examples for details.
$node |
node in which the search takes place |
---|---|
$searchString |
string containing a sequence of one or more words to be searched |
Retrieve all patients who are responding to current treatment:
declare namespace ft="http://www.w3.org/2002/04/xquery-operators-text" for $a in input()/patient where ft:text-contains($a/remarks, "responding to treatment") return $a/name
You can rewrite this query using
tf:containsText
:
for $a in input()/patient where tf:containsText($a/remarks, "responding to treatment") return $a/name
The following construct(s) refer to this construct: