thsr:expand( $query as cts:query, $entries as item()*, $new-weight as xs:double?, $min-weight as xs:double?, $filter as node()* ) as cts:query
Returns a query that searches for all the query strings specified in $query and their synonyms as found in $entries.
xquery version "1.0-ml";
import module namespace
thsr="http://marklogic.com/xdmp/thesaurus"
at "/MarkLogic/thesaurus.xqy";
cts:search(
doc("/Docs/hamlet.xml")//LINE,
thsr:expand(
cts:word-query("weary"),
thsr:lookup("/myThsrDocs/thesaurus.xml",
"weary"),
(),
(),
() )
)
(: This query returns all of the lines in Shakespeare's
Hamlet that have the word "weary" or any of the
synonyms of the word "weary" :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.