3

我在wells.xmlxml中有以下格式

<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

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

请帮助如何解决这个问题?

提前致谢。

4

1 回答 1

2

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

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

于 2012-09-10T16:12:13.827 回答