我尝试遵循搜索开发人员指南中的示例,该示例用于配置要在搜索结果中提取的记录元素。
<options xmlns="http://marklogic.com/appservices/search">
<extract-document-data>
<extract-path xmlns:pdbe="http://schemas.abbvienet.com/people-db/envelope" xmlns:pdbm="http://schemas.abbvienet.com/people-db/model">/pdbe:person-envelope/pdbm:person/pdbm:account</extract-path>
</extract-document-data>
</options>
使用这些选项,我得到了错误。
[1.0-ml] XDMP-UNBPRFX: (err:XPST0081) Prefix pdbe has no namespace binding
即使从逐字指南的示例中尝试该示例,我也同样会收到错误(只要我得到回击并尝试提取它,如果没有命中,那么它就不会出错)。
难道我做错了什么?
更新
如果先添加具有/config/namespaces
REST端点的名称空间,然后使用REST API进行搜索,则将获得提取的值。但是,我无法search:search
在查询控制台中进行测试。如果删除config/namespaces
,则在查询控制台中会看到与直接从REST终结点相同的错误。
语法摘要部分中记录的示例有一个错字(我已经警告了文档团队):xmlns属性拼写错误的“ xmnls”。在使用该逐字记录示例时,这将解决该错误。
照原样粘贴您的示例,看起来效果很好(MarkLogic 8.0-5.2)。也许您在发布问题时更正了“ xmnls”错误?
import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
search:search("hello sample-property-constraint:boo",
<options xmlns="http://marklogic.com/appservices/search">
<extract-document-data>
<extract-path
xmlns:pdbe="http://schemas.abbvienet.com/people-db/envelope"
xmlns:pdbm="http://schemas.abbvienet.com/people-db/model">
/pdbe:person-envelope/pdbm:person/pdbm:account
</extract-path>
</extract-document-data>
</options>)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句