I could use some help with fragment roots, I've never had to mess with
them before.. here's a sample document:

<doc>
  <content/> 
  <authors>
    <author>
      <country>UK</country>
      <orgname>A</orgname>
    </author>
    <author>
      <country>UK</country>
      <orgname>A</orgname>
    </author>
    <author>
      <country>India</country>
      <orgname>C</orgname>
    </author>
  </authors>
</doc>

There are range indexes on country and orgname.

I'm trying to configure fragment roots to enable 2 types of query:

Q1. search doc nodes with range query on country.
    cts:search(/doc, cts:element-range-query(xs:QName("country"), "=",
"UK"), "unfiltered")

Q2. co-occurrences on country and orgname - in the same author.
    cts:element-value-co-occurrences(xs:QName("country"),
xs:QName("orgname"))

With no fragment roots defined:
Q1. Works as expected
Q2. doesn't restrict matches to within author node, so get pairs (India,
A), (UK, C).

With fragment roots defined on doc and author:
Q1. Returns 2 results - one for each author fragment
Q2. Works as expected

Is there any way to make both these queries work unfiltered? Maybe I could
duplicate the authors node but in a different namespace for the fragment
root to do the co-occurrences? Or is there a better way without using
fragment roots?

Thanks
Rob



_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to