I am using the MarkLogic Thesaurus functionality and struggling to fetch the thesaurus entry when passing one of the synonym in thsr.lookup()
.
For example : I have my thesuarus entry in the database as
<entry xmlns="http://marklogic.com/xdmp/thesaurus">
<term>Car</term>
<part-of-speech>noun</part-of-speech>
<synonym>
<term>Ford</term>
<part-of-speech>noun</part-of-speech>
</synonym>
<synonym>
<term>automobile</term>
<part-of-speech>noun</part-of-speech>
</synonym>
<synonym>
<term>Fiat</term>
<part-of-speech>noun</part-of-speech>
</synonym>
Now when I execute the function as:
thsr.lookup('/thesaurusDoc.xml', 'Car')
I get the above entry element back as expected.
But when I try to lookup via synonym term, say:
thsr.lookup('/thesaurusDoc.xml', 'Fiat')
It doesn't return anything.
Can you please tell what am I doing wrong here and suggest any alternative if thesaurus functionality does not support the lookup via synonym?
Note: I'm using Marklogic Server Side Javascript functions and ML version is 9.0-8.1
I expect to get the entry
element back as a result.