I have the following xml document containing three patent-assignment tags
<patent-assignments>
<patent-assignment>
<patent-assignors>
<patent-assignor>
<name>TSAI, YU-WEN</name>
</patent-assignor>
</patent-assignors>
<patent-assignees>
<patent-assignee>
<name>FARADAY TECHNOLOGY CORP.</name>
</patent-assignee>
</patent-assignees>
</patent-assignment>
<patent-assignment>
<patent-assignors>
<patent-assignor>
<name>APPLE</name>
</patent-assignor>
</patent-assignors>
<patent-assignees>
<patent-assignee>
<name>GOOGLE INC</name>
</patent-assignee>
</patent-assignees>
</patent-assignment>
<patent-assignment>
<patent-assignors>
<patent-assignor>
<name>GOOGLE INC</name>
</patent-assignor>
</patent-assignors>
<patent-assignees>
<patent-assignee>
<name>FARADAY TECHNOLOGY CORP.</name>
</patent-assignee>
</patent-assignees>
</patent-assignment>
</patent-assignments>
Now when I run the following search query:-
import module namespace search="http://marklogic.com/appservices/search" at
"/Marklogic/appservices/search/search.xqy";
declare variable $options:=
<options xmlns="http://marklogic.com/appservices/search">
<transform-results apply="raw"/>
</options>;
search:search("apple", $options, 1, 1)/search:result
I get the full document as the output but matching word "APPLE" is in only second patent-assignment tag of the xml. I want to get only second patent-assignment as the output not the full document. If I use snippets then it shows the document and element name where it finds the match but it did not return the actual output. I want that particular patent-assignment tag as the output where the matching word is found.