thsr.setEntry( uri as String, entry as element(thsr.entry)|Object ) as null
Adds the entry $entry to the thesaurus at $uri.
Parameters | |
---|---|
uri | The URI of a thesaurus document. |
entry | An entry to add to the thesaurus, can either be an xml element or javascript object. |
install_dir/Config/thesaurus.xsd
), an error
is raised.
const thsr = require("/MarkLogic/thesaurus"); declareUpdate(); thsr.setEntry("/myThsrDocs/roget.xml", { "term":"Car", "synonyms":[ {"term":"Ford", "partOfSpeech":"noun" }, {"term":"automobile", "partOfSpeech":"noun" }, {"term":"Fiat", "partOfSpeech":"noun" } ] })