Changes

Jump to navigation Jump to search
824 bytes removed ,  10:41, 25 April 2022
</syntaxhighlight>
Please note that scoring propagation was removed with {{Mark|Version 9.5}}. The following expressions will now yield {{Code|0}}: <syntaxhighlight lang="xquery">let $string := 'a b'return ft:score($string contains text 'a' and $string contains text 'b'), for $n score $s in db:open('factbook')//religions[text() contains text 'orthodox']order by $s descendingreturn $s || ': ' || $n</syntaxhighlight> Scoring is still supported within full-text expressions, by {{Function|Full-Text|ft:search}}, and by simple predicate tests that can be rewritten to {{Function|Full-Text|ft:search}}:
<syntaxhighlight lang="xquery">
return $s || ': ' || $n
</syntaxhighlight>
 
The reason for removing the scoring propagation was that the storage of scoring values required additional memory, even if scoring is not required.
==Thesaurus==
BaseX supports One or more thesaurus files can be specified in a full-text queries using thesauri, but it does not provide a default thesaurusexpression. This is why queries such asThe following query returns {{Code|false}}:
<syntaxhighlight lang="xquery">
</syntaxhighlight>
will return <code>false</code>. However, if If a thesaurus is specified, then the result will be <code>true</code>: <syntaxhighlight lang="xquery">'hardware' contains text 'computers' using thesaurus at 'thesaurus.xml'</syntaxhighlight> ; Thesaurus documentemployed…
<syntaxhighlight lang="xml">
</syntaxhighlight>
Thesaurus files must …the result will be the same as for the thesauri files used in the [https{{Code|true}}://dev.w3.org/2007/xpath-full- <syntaxhighlight lang="xquery">'hardware' contains text-10-test-suite XQuery and XPath Full Text 1.0 Test Suite]. It is an XML with structure defined by an [https://dev.w3'computers' using thesaurus at 'thesaurus.org/2007xml'</xpath-full-text-10-test-suite/TestSuiteStagingArea/TestSources/thesaurus.xsd XSD Schema].syntaxhighlight>
By default, both Thesaurus files must comply with the [https://dev.w3.org/2007/xpath-full-text-10-test-suite/TestSuiteStagingArea/TestSources/thesaurus.xsd XSD Schema] of the XQFT Test Suite (but the namespace can be omitted). Apart from the relationship defined in [https://www.iso.org/standard/7776.html ISO 2788] (NT: narrower team, RT: related term, etc.) and , custom relationships are supportedcan be used.
The type of relationship and the level depth can be specified as well:
</syntaxhighlight>
Fuzzy search is based on the Levenshtein distance. The maximum number of allowed errors is calculated by dividing the token length of a specified query term by 4, preserving a minimum of 1 errors. The query above yields two results as there is no error between the query term “house” and the text node “house”, and one error between “house” and “hous”.
A user-defined value can be adjusted globally via the {{Option|LSERROR}} option or, since {{Version|9.6}}, via an additional argument:
<syntaxhighlight lang="xquery">
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu