Changes

Jump to navigation Jump to search
842 bytes added ,  13:11, 25 October 2013
| '''Summary'''
|Returns all text nodes from the full-text index of the database {{Code|$db}} that contain the specified {{Code|$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 {{Code|$options}} argument can be used to overwrite the default control full-text options, which processing. Options can be either specified<br/>
* as children of an {{Code|&lt;options/&gt;}} element, e.g.:
<pre class="brush:xml">
* as map, which contains all key/value pairs:
<pre class="brush:xml">
map { "key1" := "value1", ... }
</pre>
The following keys options are supported(the introduction on [[Full-Text]] processing gives you some examples):* {{Code|mode}}: determines the search mode (also called [http://www.w3.org/TR/xpath-full-text-10/#ftwords AnyAllOption])how query terms are searched. Allowed values are {{Code|any}}, {{Code|any word}}, {{Code|all}}, {{Code|all words}}, and {{Code|phrase}}. {{Code|any}} is the default search mode.
* {{Code|fuzzy}}: turns fuzzy querying on or off. Allowed values are an empty string or {{Code|true}}, or {{Code|false}}. By default, fuzzy querying is turned off.
* {{Code|wildcards}}: turns wildcard querying on or off. Allowed values are an empty string or {{Code|true}}, or {{Code|false}}. By default, wildcard querying is turned off.
The following options have been added in {{Version|7.8}}:
* {{Code|ordered}}: requires that all terms occur in the order in which they are specified. Allowed values are {{Code|true}} and {{Code|false}}. The default is {{Code|false}}.
* {{Code|content}}: specifies that the matched terms need to occur at the beginning or end of a searched string, or need to cover the entire string. Allowed values are {{Code|start}}, {{Code|end}}, and {{Code|entire}}. By default, this option is turned off.
* {{Code|scope}}: defines the scope in which tokens need to occur. The option has the following sub options:
** {{Code|same}}: can be set to {{Code|true}} or {{Code|false}}; it specifies if tokens need to occur in the same or different units.
** {{Code|unit}}: can be {{Code|sentence}} or {{Code|paragraph}}. It specifies the unit for finding tokens.
|-
| '''Errors'''
|
* {{Code|ft:search("DB", "QUERY")}} returns all text nodes of the database {{Code|DB}} that contain the term {{Code|QUERY}}.
* <code>ft:search("DB", ("2010","2011"), map { 'mode':='all' })</code><br/>returns all text nodes of the database {{Code|DB}} that contain the numbers {{Code|2010}} and {{Code|2011}}.
* The last example iterates over five databases and returns all elements containing terms similar to {{Code|Hello World}} in the text nodes:
<pre class="brush:xquery">
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu