MarkLogic 8 - XQuery - 如何做 cts:element-value-query 部分匹配
MarkLogic 8 - XQuery - How to do cts:element-value-query partial match
假设我有:
<location>Houston, TX</location>
我可以轻松做到:
cts:element-value-query(xs:QName("location"), "Houston, TX")
但是我怎样才能轻松做到:
cts:element-值查询(xs:QName("location"), "*TX*")
您真正想要的是 cts:element-word-query(xs:QName("location"), "TX")
匹配单词而不是通配符。有一些方法可以使用通配符,但这里不需要。
假设我有:
<location>Houston, TX</location>
我可以轻松做到:
cts:element-value-query(xs:QName("location"), "Houston, TX")
但是我怎样才能轻松做到: cts:element-值查询(xs:QName("location"), "*TX*")
您真正想要的是 cts:element-word-query(xs:QName("location"), "TX")
匹配单词而不是通配符。有一些方法可以使用通配符,但这里不需要。