MarkLogic Smart Mastering不返回匹配项

问题描述 投票:0回答:1

我正在使用基于Data Hub框架的智能母版框架。执行智能母带处理时遇到问题。我确实得到了匹配结果,但是它不包含匹配的文档。当我运行时:

import module namespace matcher = "http://marklogic.com/smart-mastering/matcher"
at "com.marklogic.smart-mastering/matcher.xqy";
matcher:find-document-matches-by-options-name(
fn:doc("/Trade/126753e6-ca73-454f-b6cd-1bdf63323ac8.json"), "da49a395-3389-4ba2-8fbb-ab2615ee618d",
fn:true(), cts:collection-query("Cash") )


在我的查询控制台中,它确实返回匹配状态以及匹配的文档。

<results total="1" page-length="200" start="1">
<match-query>
<cts:and-not-query xmlns:cts="http://marklogic.com/cts">
<cts:positive>
<cts:and-query>
<cts:collection-query>
<cts:uri>mdm-content</cts:uri>
</cts:collection-query>
<cts:or-query>
<cts:and-query>
<cts:json-property-value-query weight="10">
<cts:property>cshTrdNotiAmt</cts:property>
<cts:value xml:lang="en">120</cts:value>
<cts:value xsi:type="xs:double" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">120</cts:value>
<cts:option>case-insensitive</cts:option>
</cts:json-property-value-query>
<cts:json-property-value-query weight="10">
<cts:property>cshTrdAmtCrryCd</cts:property>
<cts:value xml:lang="en">GBP</cts:value>
<cts:option>case-insensitive</cts:option>
</cts:json-property-value-query>
</cts:and-query>
</cts:or-query>
</cts:and-query>
</cts:positive>
<cts:negative>
<cts:document-query>
<cts:uri>/Statement/126753e6-ca73-454f-b6cd-1bdf63323ac8.json</cts:uri>
</cts:document-query>
</cts:negative>
</cts:and-not-query>
</match-query>
<result uri="/Cash/9b627589-5fa5-481a-b498-d7cbbf2bfc83.json" index="1" score="20" threshold="R100001" action="">
<matches>
<match>fn:doc("/Cash/9b627589-5fa5-481a-b498-d7cbbf2bfc83.json")/envelope/instance/CashBook/number-node("cshTrdNotiAmt")</match>
<match>fn:doc("/Cash/9b627589-5fa5-481a-b498-d7cbbf2bfc83.json")/envelope/instance/CashBook/text("cshTrdAmtCrryCd")</match>
</matches>
</result>
</results>

但是通过我的java应用程序进行rest调用时,它不返回匹配的文档。我调用了一个自定义的匹配文件,该文件调用:

let resultXML = matcher.findDocumentMatchesByOptions(doc, options,
                    1, pageOffset, includeMatch, cts.collectionQuery(collectionName));

甚至在将其解析为json之前,我仍然没有获得匹配的文档,并且我将includeMatch设置为true。我想念什么吗?

marklogic marklogic-dhf
1个回答
0
投票

我要问的第一个问题是您在QConsole中使用同一用户并进行REST调用。如果不是,那么很可能是权限问题。

© www.soinside.com 2019 - 2024. All rights reserved.