MarkLogic 10 Product Documentation
thsr.queryLookupthsr.queryLookup(
uri as String[],
query as cts.query,
[output-kind as String]
) as Sequence
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.wordQuery ,
cts.andQuery , 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 "objects".
|
Example
const thsr = require("/MarkLogic/thesaurus");
thsr.queryLookup("/myThsrDocs/thesaurus.xml", cts.wordQuery("weary"))
=> returns the thesaurus entry for the term "weary"
Copyright © 2024 MarkLogic Corporation. MARKLOGIC is a
registered trademark of MarkLogic Corporation.