Marklogic:search中的分页:基于Element节点而不是文档uri进行搜索

Marklogic:search中的分页:基于Element节点而不是文档uri进行搜索,marklogic,Marklogic,我有以下xml格式的wells.xml <wells><well><date-created>MMDDYYYY</date-created><title>ABC</title></well><well><date-created>MMDDYYYY</date-created><title>ABC</title></well></well

我有以下
xml
格式的wells.xml

<wells><well><date-created>MMDDYYYY</date-created><title>ABC</title></well><well><date-created>MMDDYYYY</date-created><title>ABC</title></well></wells>
mmddyyyyabcmmddyyyabc
现在我执行了以下搜索查询:

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
声明命名空间ts=”http://marklogic.com/mlu/clover/docs-xml";
导入模块命名空间搜索=”http://marklogic.com/appservices/search“在“/MarkLogic/appservices/search/search.xqy”;
声明变量$options:=;
对于搜索中的$doc:search(“ABC”,$options,1,1)//search:match
返回$doc
结果是,无论我在
search:search
中通过(1,1)组合,它都会给我两个结果集,作为同一文档中的两条记录

请帮助如何解决此问题


提前感谢。

搜索库以及MarkLogic的所有索引都是基于片段/文档的。因此,最好将wells文档拆分为单独的well文档。但是,通过添加一个可搜索的表达式,您也可以轻松实现所需的功能。将以下内容添加到搜索选项中:

<searchable-expression>//well</searchable-expression>
//好的

感谢您的快速回复,我知道将wells文档拆分为多个well文档是解决方案之一,但我无法做到这一点,也尝试了您的解决方案:但在我通过(1,1)组合的地方仍然得到了两个结果。@user1660340我在发布之前检查过,它应该可以工作。我按原样存储了您的XML,运行了搜索,得到了两个匹配项和一个结果。使用可搜索表达式,我仍然得到一个结果,但只有一个匹配。比赛应该分开统计。您使用的是哪个版本的ML?我用的是最新的。。