Search code examples
marklogicmarklogic-8

Is there a way to test the return values of a path range index in Marklogic's Query Console?


I am setting up indexes in a database containing MODS XML documents and I'd like to be able to test each index in Query Console to make sure that the correct elements are being indexed.

I've used cts:valid-index-path() to make sure that the xpath is valid and I just came across cts:path-range-query, but I'm not sure it's doing what I want it to do.

For example, I have a MODS document that contains a title and a uniform title like this:

  <titleInfo>
    <nonSort>The </nonSort>
    <title>Friend : a religious and literary journal</title>
  </titleInfo>
  <titleInfo type="uniform">
    <title>Friend (Philadelphia, Pa.)</title>
  </titleInfo>

I want to be able to test the path range index set-up on titleInfo/@type="uniform" to make sure that it is only indexing <titleInfo type="uniform"> and excluding <titleInfo>.


Solution

  • Do either of the following functions get close to what you need?

    cts:values(cts:path-reference(...the path for the index...))
    cts.valueMatch(cts:path-reference(...the path for the index...))
    

    Hoping that helps,