嗨,我正在使用搜索API开发搜索功能,我已经在节点“ ti”上定义了约束,并在数据库中配置了路径范围索引。当我尝试使用约束进行搜索时,它会显示零结果,但是在Marklogic 8中运行的相同内容是配置中缺少任何内容。请提出建议。下面是代码。
xquery version "1.0-ml";
import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
let $PageLength := 10
let $Start := 1
let $SearchOption :=
<options xmlns="http://marklogic.com/appservices/search">
<return-facets>true</return-facets>
<term>
<term-option>case-insensitive</term-option>
<term-option>wildcarded</term-option>
<term-option>stemmed</term-option>
<term-option>diacritic-insensitive</term-option>
<term-option>punctuation-insensitive</term-option>
</term>
<constraint name="ti">
<range collation="http://marklogic.com/collation/" type="xs:string" facet="true">
<path-index>/bibliog/ti</path-index>
</range>
</constraint>
<additional-query>{cts:collection-query('ID xmls')}</additional-query>
</options>
return search:search('ti:Indium', $SearchOption, $Start, $PageLength)