Hi folks,

I think I have run into a bit of an edge case, and I am struggling to find a 
complete solution in ML 5. Using Search API I am trying to provide the 
following, with (reasonably) accurate facet and result counts:

1. Search //doc for terms
2. Search //citation for terms
3. Search //doc ancestors of <citation> meeting certain criteria

The content looks like:

<root>
<doc>
<p>Some paragraph text. <citation type="type">Some citation info</citation></p>
<p>...</p>
</doc>
...
</root>

I created a fragment roots on <doc> and <citation> to satisfy 1 and 2. The 
problem that searching for one fragment type with a query for a descendant 
fragment type breaks a search of type 3. For example:

cts:search(//doc, 
cts:element-attribute-range-query(Qname("","citation"),QName("","type"),"=","some-type"))

What I have discovered is that although there are now both doc *and* citation 
fragments matching this range query, ML only returns citation fragments, which 
get nulled out in index resolution (I assume) and search returns 0 results. 
Removing the fragment root for citation, the range query returns doc fragments, 
and search returns the correct results. However, without the citation 
fragments, a search over //citation will return inaccurate result and facet 
counts, since they will be calculated based on its ancestor fragments.

So I don't know how to satisfy both 2 and 3. Our content model and search 
requirements do not seem very exotic. Intuitively, it seems like the query 
should return all of the matching doc and citation fragments instead of 
assuming I want only citation, especially that assumption may be different from 
what is defined in the xpath expression. But it appears to be by design, and I 
am stumped at a workaround. 

Is there another way to approach this that I have not considered?

Best regards,

Will


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

Reply via email to