我正在针对单词查询执行 XQuery 搜索,以使用共现返回值。但问题是,在执行通配符搜索时,某些误报会作为匹配文档的一部分返回。执行的元素词查询是
cts:element-word-query(fn:QName("", "contents"), "project monitor*",
("case-insensitive","punctuation-insensitive","stemmed","lang=en"), 1)
执行的查询是
cts:element-value-co-occurrences(xs:QName("node1"), xs:QName("node2"),
("collation=http://marklogic.com/collation/"),
cts:and-query((
cts:element-word-query(fn:QName("", "node3"), "project monitor*", ("case-insensitive","punctuation-insensitive","stemmed","lang=en"), 1),
cts:element-range-query(
xs:QName("node4"),
"=",
xs:long('1234567891011')
),
cts:element-attribute-range-query(
xs:QName("node5"),
xs:QName("attribute1"),
"=",
""
),
cts:collection-query('collection1'),
()
))
)
它返回两个匹配结果,一个是正的,一个是误报的。
<cts:co-occurrence>
<cts:value xsi:type="xs:string">General</cts:value>
<cts:value xsi:type="xs:string">/pdf/text-document/12345_0_1234.xml</cts:value>
</cts:co-occurrence>
<cts:co-occurrence>
<cts:value xsi:type="xs:string">Other</cts:value>
<cts:value xsi:type="xs:string">/pdf/text-doc/1234_1_0000.xml</cts:value>
</cts:co-occurrence>