thsr.addSynonym( entry as element(thsr.entry), synonym as element(thsr.synonym)|Object ) as null
Adds a synonym to the specified thesaurus entry.
Parameters | |
---|---|
entry | A thesaurus entry. |
synonym | A synonym to add to a thesaurus entry, can either be an xml element or javascript object. |
const thsr = require("/MarkLogic/thesaurus"); declareUpdate(); thsr.addSynonym(thsr.lookup("/myThsrDocs/roget.xml", "car")[1], {"term":"Alfa Romeo"})