0

I am using smart mastering framework based on Data Hub framework. I am running into an issue when executing smart mastering. I do get a match result back, but it does not contain the documents which were matched. When I run:

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") )


in my query console, it does return the match stats along with the matched documents.

<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>

However making a rest call through my java application it does not return the matched documents.I call a custom match file which calls:

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

Even before parsing it to json, I still do not get the matched documents and I have includeMatch set to true. Am I missing something?

X2015jpp
  • 143
  • 2
  • 14

1 Answers1

0

The first question I would have would be are you using the same user in QConsole and for the REST calls. If not, then it is most likely a permissions issue.