Loading TOC...

thsr.addSynonym

thsr.addSynonym(
   $entry as element(thsr.entry),
   $synonym as element(thsr.synonym)|Object
) as null

Summary

Adds a synonym to the specified thesaurus entry.

Parameters
$entryA thesaurus entry.
$synonym A synonym to add to a thesaurus entry, can either be an xml element or javascript object.

Usage Notes

The synonym and the entry specified must conform to the thesaurus schema and must be namespace-qualified with the "http://marklogic.com/xdmp/thesaurus" namespace.

Example

  var thsr = require("/MarkLogic/thesaurus");
  declareUpdate();

  thsr.addSynonym(
     // note the "elements" option, because thsr.addSynonym requires 
     // the entry to be in XML format, not JSON format
     thsr.lookup("/myThsrDocs/roget.xml", 
                               "car", "elements"),
                 {"term":"Alfa Romeo"})
  

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy