Changes

Jump to navigation Jump to search
14 bytes added ,  14:38, 16 April 2019
 
This [[Module Library|XQuery Module]] extends the [http://www.w3.org/TR/xpath-full-text-10 W3C Full Text Recommendation] with some useful functions: The index can be directly accessed, fulltext results can be marked with additional elements, or the relevant parts can be extracted. Moreover, the score value, which is generated by the {{Code|contains text}} expression, can be explicitly requested from items.
=Conventions=
 
{{Mark|Updated with Version 9.0}}:
All functions and errors in this module are assigned to the <code><nowiki>http://basex.org/modules/ft</nowiki></code> namespace, which is statically bound to the {{Code|ft}} prefix.<br/>
|-
| width='120' | '''Signatures'''
|{{Func|ft:search|$db as xs:string, $terms as item()*|text()*}}<br/>{{Func|ft:search|$db as xs:string, $terms as item()*, $options as map(xs:string, item()*)?|text()*}}
|-
| '''Summary'''
|-
| '''Errors'''
|{{Error|db:open|Database Module#Errors}} The addressed database does not exist or could not be opened.<br/>{{Error|db:no-index|Database Module#Errors}} the index is not available.<br/>{{Error|conflictoptions|#Errors}} the fuzzy and wildcard option cannot be both specified.
|-
| '''Examples'''
|-
| width='120' | '''Signatures'''
|{{Func|ft:contains|$input as item()*, $terms as item()*|xs:boolean}}<br/>{{Func|ft:contains|$input as item()*, $terms as item()*, $options as map(xs:xstring, item()*)?|xs:boolean}}
|-
| '''Summary'''
|-
| '''Errors'''
|{{Error|conflictoptions|#Errors}} the fuzzy and wildcard option cannot be both specifiedoptions are conflicting.
|-
| '''Examples'''
==ft:mark==
 
{| width='100%'
|-
==ft:extract==
 
{| width='100%'
|-
==ft:score==
 
{| width='100%'
|-
==ft:tokenize==
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|ft:tokenize|$input string as xs:string?|xs:string*}}<br/>{{Func|ft:tokenize|$input string as xs:string?, $options as map(xs:xstring, item()*)?|xs:string*}}
|-
| '''Summary'''
|Tokenizes the given {{Code|$inputstring}} string, using the current default full-text options or the {{Code|$options}} specified as second argument, and returns a sequence with the tokenized string. The following options are available:
* {{Code|case}}: determines how character case is processed. Allowed values are {{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 are {{Code|insensitive}} and {{Code|sensitive}}. By default, search is diacritical insensitive.
==ft:normalize==
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|ft:normalize|$input string as xs:string?|xs:string*}}<br/>{{Func|ft:normalize|$input string as xs:string?, $options as map(xs:xstring, item()*)?|xs:string*}}
|-
| '''Summary'''
|Normalizes the given {{Code|$inputstring}} string, using the current default full-text options or the {{Code|$options}} specified as second argument. The function expects the same arguments as [[#ft:tokenize|ft:tokenize]].
|-
| '''Examples'''
=Errors=
 
{{Mark|Updated with Version 9.0}}:
{| class="wikitable" width="100%"
|Description
|-
|{{Code|BXFT0001options}}
|Both wildcards and fuzzy search have been specified as search options.
|}
=Changelog=
 
; Version 9.1
* Updated: [[#ft:tokenize|ft:tokenize]] and [[#ft:normalize|ft:normalize]] can be called with empty sequence.
;Version 9.0
* Updated: error codes updatesupdated; errors now use the module namespace
;Version 8.0
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu