Tutan Ramen
Tutan Ramen

Reputation: 1252

MarkLogic 8 - XQuery - How to do cts:element-value-query partial match

Say I have:

<location>Houston, TX</location>

I can easily do:

cts:element-value-query(xs:QName("location"), "Houston, TX")

But how can I easily do: cts:element-value-query(xs:QName("location"), "*TX*")

Upvotes: 2

Views: 518

Answers (1)

hunterhacker
hunterhacker

Reputation: 7142

What you really want is cts:element-word-query(xs:QName("location"), "TX") to match on the word rather than a wildcard. There's ways to do wildcards, but that's not needed here.

Upvotes: 2

Related Questions