Loading TOC...

MarkLogic Server 11.0 Product Documentation
thsr:query-lookup

thsr:query-lookup(
   $uri as xs:string*,
   $query as cts:query,
   [$output-kind as xs:string]
) as item()*

Summary

Returns a sequence of all entries that are found by looking up terms in the query and/or subqueries of $query in the thesaurus document(s) at $uri.

Parameters
uri The URI of the thesaurus document(s).
query A cts:query item from any of the cts:*-query functions ( cts:word-query, cts:and-query, etc.).
output-kind The kind of the returned items. If "elements", xml elements are returned; if "objects", javascript objects are returned.

The default value is "elements".

Example

  xquery version "1.0-ml";
  import module namespace 
	   thsr="http://marklogic.com/xdmp/thesaurus" 
                           at "/MarkLogic/thesaurus.xqy";

  let $query := cts:word-query("weary")
  return 
      thsr:query-lookup("/myThsrDocs/thesaurus.xml", 
                        $query)

   => All entries for the term "weary" in the specified 
      thsesaurus document
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.