Kindle Q
Kindle Q

Reputation: 944

MarkLogic 7 Return Document that have a specific element

the cts:element-value-query in MarkLogic 7 does not work like MarkLogic 8, I would like to return the documents that have an element without attention to its value my query is like:

cts:search(collection("My-Collection"),cts:element-value-query(xs:QName("Element1"), ""))

I would like to return all of the documents that have the Element1 in MarkLogic 7!!??

Upvotes: 0

Views: 78

Answers (1)

grtjn
grtjn

Reputation: 20414

Try:

cts:search(
  collection("My-Collection"),
  cts:element-query(xs:QName("Element1"), cts:and-query(()) )
)

Should work in all MarkLogic versions.

HTH!

Upvotes: 2

Related Questions