Changes

Jump to navigation Jump to search
No change in size ,  15:13, 26 May 2012
m
Text replace - "{{Mono|" to "{{Code|"
|-
| '''Summary'''
|Returns all text nodes from the full-text index of the [[Database Module#Database Nodes|database node]] <code>$db</code> that contain the specified {{MonoCode|$terms}}.<br/>The options used for building the full-text will also be applied to the search terms. As an example, if the index terms have been stemmed, the search string will be stemmed as well.The {{MonoCode|$options}} argument can be used to overwrite the default full-text options. It can be specified as* {{MonoCode|element(options)}}: <code>&lt;options/&gt;</code> must be used as root element, and the parameters are specified as child nodes, with the element name representing the key and the text node representing the value:<br />
<pre class="brush:xml">
<options>
* [[Map Module|map structure]]: all parameters can be directly represented as key/value pairs:<br /><code>map { "key" := "value", ... </code>}<br/>This variant is more compact, but please note that the W3Cā€™s specification of maps in XQuery is still work in progress.
The following keys are supported:
* {{MonoCode|mode}}: determines the search mode (also called [http://www.w3.org/TR/xpath-full-text-10/#ftwords AnyAllOption]). Allowed values are {{MonoCode|any}}, {{MonoCode|any word}}, {{MonoCode|all}}, {{MonoCode|all words}}, and {{MonoCode|phrase}}. {{MonoCode|any}} is the default search mode.* {{MonoCode|fuzzy}}: turns fuzzy querying on or off. Allowed values are an empty string or {{MonoCode|true}}, or {{MonoCode|false}}. By default, fuzzy querying is turned off.* {{MonoCode|wildcards}}: turns wildcard querying on or off. Allowed values are an empty string or {{MonoCode|true}}, or {{MonoCode|false}}. By default, wildcard querying is turned off.
|-
| '''Errors'''
| '''Examples'''
|
* <code>ft:search("DB", "QUERY")</code> returns all text nodes of the database {{MonoCode|DB}} that contain the term {{MonoCode|QUERY}}.* <code>ft:search("DB", (2010,2011), map { 'mode':='all' })</code><br/>returns all text nodes of the database {{MonoCode|DB}} that contain the numbers {{MonoCode|2010}} and {{MonoCode|20111}}.* The last example iterates over five databases and returns all elements containing terms similar to {{MonoCode|Hello World}} in the text nodes:
<pre class="brush:xquery">
let $terms := "Hello Worlds"
|-
| width='90' | '''Signatures'''
|{{MonoCode|<b>ft:tokens</b>($db as item()) as element(value)*}}<br/>{{MonoCode|<b>ft:tokens</b>($db as item(), $prefix as xs:string) as element(value)*}}
|-
| '''Summary'''
|Returns all full-text tokens stored in the index of the [[Database Module#Database Nodes|database node]] <code>$db</code>, along with their numbers of occurrences.<br/>If {{MonoCode|$prefix}} is specified, the returned nodes will be refined to the strings starting with that prefix. The prefix will be tokenized according to the full-text used for creating the index.
|-
| '''Errors'''
|-
| width='90' | '''Signatures'''
|{{MonoCode|<b>ft:tokenize</b>($input as xs:string) as xs:string*}}
|-
| '''Summary'''
|Tokenizes the given {{MonoCode|$input}} string, using the current default full-text options.
|-
| '''Examples'''
|
* <code>ft:tokenize("No Doubt")</code> returns the two strings {{MonoCode|no}} and {{MonoCode|doubt}}.* <code>declare ft-option using stemming; ft:tokenize("GIFTS")</code> returns a single string {{MonoCode|gift}}.
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu