Hello,
I have a question regarding the usage of the ft:mark() function.
Database content:
<root> <div> <p>Some text <b>text search text</b> some more text</p> </div> </root>
XQuery:
<result> { let $search := 'search' for $match at $pos in //*[text() contains text {$search}] let $match_parent := $match/.. return <match>{ft:mark($match_parent//*[text() contains text {$search}])}</match> } </result>
Current result:
<result> <match> <b>text <mark>search</mark> text</b> </match> </result>
What I would like to achieve is the following output:
<result> <match> <p>Some text <b>text <mark>search</mark> text</b> some more text</p> </match> </result>
ft:mark() returns the found element node with the marked content inside.
Is it possible to get the whole paragraph content (the parent element of the found element) with the marker element inside?
Any help would be much appreciated.
Best regards Johannes