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

时间:2012-09-10 14:07:00

标签: marklogic

我在 wells.xml

中遵循xml格式
<wells><well><date-created>MMDDYYYY</date-created><title>ABC</title></well><well><date-created>MMDDYYYY</date-created><title>ABC</title></well></wells>

现在我执行了以下搜索查询:

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

结果它给了我两个结果集作为同一文档中的记录,无论我在search:search中传递(1,1)组合。

请帮助解决此问题?

提前致谢。

1 个答案:

答案 0 :(得分:2)

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

<searchable-expression>//well</searchable-expression>

HTH!

相关问题