Loading TOC...

thsr:add-synonym

thsr:add-synonym(
   $entry as element(thsr:entry),
   $synonym as item()
) as empty-sequence()

Summary

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.

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

  xquery version "1.0-ml";
  import module namespace 
	thsr="http://marklogic.com/xdmp/thesaurus" 
                             at "/MarkLogic/thesaurus.xqy";
  thsr:add-synonym(thsr:lookup("/myThsrDocs/roget.xml", 
                               "car")[1],
                 <thsr:synonym>
                    <thsr:term>Alfa Romeo</thsr:term>
                 </thsr:synonym>)
  

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