Changes

Jump to navigation Jump to search
1,881 bytes added ,  20:10, 17 November 2013
|-
| '''Errors'''
|{{Error|BXDB0002|XQuery Errors#BaseX Errors}} The addressed database does not exist or could not be opened.<br/>{{Error|BXDB0004|Database Module#Errors}} the full-text index is not available.<br/>{{Error|BXFT0001|#Errors}} both the fuzzy and wildcard querying was selectedoption cannot be both specified.
|-
| '''Examples'''
let $dbname := 'DB' || $db
return ft:search($dbname, $terms, $options)/..
</pre>
|}
 
==ft:contains==
 
{{Mark|Introduced with Version 7.8:}}
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|ft:contains|$input as item()*, $terms as item()*|xs:boolean}}<br/>{{Func|ft:search|$input as item()*, $terms as item()*, $options as item()|xs:boolean}}
|-
| '''Summary'''
|Checks if the specified {{Code|$input}} items contain the specified {{Code|$terms}}.<br/>The function is similar to the [[Full-Text]] expression {{Code|contains text}}, but the processing {{Code|$options}} can be dynamically specified:<br/>
* as children of an {{Code|&lt;options/&gt;}} element, e.g.:
<pre class="brush:xml">
<options>
<key1 value='value1'/>
...
</options>
</pre>
* as map, which contains all key/value pairs:
<pre class="brush:xml">
{ "key1": "value1", ... }
</pre>
The function supports the same options as the [[ft:search|ft:search]] function and some more:
* {{Code|case}}: determines how character case is processed. Allowed values {{Code|insensitive}}, {{Code|sensitive}}, {{Code|upper}} and {{Code|lower}}. By default, search is case insensitive.
* {{Code|diacritics}}: determines how diacritical characters are processed. Allowed values {{Code|insensitive}} and {{Code|sensitive}}. By default, search is diacritical insensitive.
* {{Code|stemming}}: determines is tokens are stemmed. Allowed values are {{Code|true}} and {{Code|false}}. By default, stemming is turned off.
* {{Code|language}}: determines the language. This option is relevant for stemming tokens. All language codes are supported. By default, the language option is not set.
|-
| '''Errors'''
|{{Error|BXFT0001|#Errors}} the fuzzy and wildcard option cannot be both specified.
|-
| '''Examples'''
|
* Checks if {{Code|jack}} or {{Code|john}} occurs in the input string {{Code|John Doe}}:
<pre class="brush:xquery">
ft:contains("John Doe", ("jack", "john"), { "mode": "any" })
</pre>
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu