Subject to this document: -
<items> <item><type>T1</type><value>V1</value></item> <item><type>T2</type><value>V2</value></item> </items>
unsurprisingly, I found that this would return the page in cts:uris() : -
cts:and-query(( cts:element-query(xs:QName('item'), cts:element-value-query(xs:QName('type'),'T1') ), cts:element-query(xs:QName('item'), cts:element-value-query(xs:QName('value'),'V2') ) ))
but somewhat surprisingly (at least for me), I also believe that this will also be: -
cts:element-query(xs:QName('item'), cts:and-query(( cts:element-value-query(xs:QName('type'),'T1'), cts:element-value-query(xs:QName('value'),'V2') )) )
This does not seem to be correct, since there is no single element with type = T1 and value = V2 . This seems false to me.
I misunderstood how cts:element-query works? (I have to say that the documentation is not particularly clear in this area).
Or is it something where MarkLogic aims to give me the result that I expect, and if I had more or better indexes, I would be less likely to get a false positive match.
source share