I have following xml format in wells.xml
<wells><well><date-created>MMDDYYYY</date-created><title>ABC</title></well><well><date-created>MMDDYYYY</date-created><title>ABC</title></well></wells>
Now I performed following search query :
declare namespace ts= "http://marklogic.com/mlu/clover/docs-xml";
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="snippet"></transform-results></options>;
for $doc in search:search("ABC",$options,1,1)//search:match
return $doc
In result it is giving me two results set as both record in a same document wherever I passed (1,1) combination in search:search.
Please help how to resolve this issue?
Thanks in advance.
The search library, as well as all of MarkLogic's indexes are fragment/document based. So, perhaps best to split the wells document into individual well documents. But you can also easily achieve what you are looking for by adding a searchable expression. Add the following to your search options:
<searchable-expression>//well</searchable-expression>
HTH!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With