marklogic-community / marklogic-samplestack

A sample implementation of the MarkLogic Reference Architecture
Apache License 2.0
82 stars 56 forks source link

cts:highlight not working as expected #711

Open lakshmananTechM opened 6 years ago

lakshmananTechM commented 6 years ago

below code not working as expected... cts_entity_highlight

I Run the below code in QueryConsole

xquery version "1.0-ml"; 
let $myxml := <node>Queen Elizabeth celebrated her Diamond Jubilee in London this June. A thanksgiving service at St Paul's Cathedral where the ArchBishop of Canterbury paid tribute to her "lifelong dedication". One thousand boats took part in the Diamond Jubilee Thames River Pageant, the first of its kind for 350 years! </node> 
return cts:entity-highlight($myxml, element { fn:replace($cts:entity-type, ":", "-") }{ $cts:text })

i getting below result

<node>Queen Elizabeth celebrated her Diamond Jubilee in London this June. A thanksgiving service at St Paul's Cathedral where the ArchBishop of Canterbury paid tribute to her "lifelong dedication". One thousand boats took part in the Diamond Jubilee Thames River Pageant, the first of its kind for 350 years! </node>

but expected result is different... i attached expected result...

popzip commented 6 years ago

THat code doesn't look familiar - is this related to Samplestack?

popzip commented 6 years ago

I did some investigation, it looks like cts:entity-highlight was removed in MarkLogic 8. What version of MarkLogic are you using? Where did you get the sample code?

lakshmananTechM commented 6 years ago

Thanks for your reply. I found that it is old version 'cts:entity-highlight'. i took this same code from marklogic learning sample.