David,
Try the <searchable-expression> option.
Using your example, with no namespaces, you would do:
<searchable-expression>
/doc/sub-doc
</searchable-expression>
Here's an example with namespaces from search:search documentation:
<searchable-expression xmlns:ex="http:example.com"
xmlns:com="http://company.com">/ex:orders/com:company
</searchable-expression>
--Colleen
Colleen Whitney
MarkLogic Corporation
Phone +1 650 655 2366
email [email protected]
web www.marklogic.com
This e-mail and any accompanying attachments are confidential. The information
is intended solely for the use of the individual to whom it is addressed. Any
review, disclosure, copying, distribution, or use of this e-mail communication
by others is strictly prohibited. If you are not the intended recipient, please
notify us immediately by returning this message to the sender and delete all
copies. Thank you for your cooperation.
________________________________________
From: [email protected]
[[email protected]] On Behalf Of Steiner, David J.
(LNG-DAY) [[email protected]]
Sent: Tuesday, July 06, 2010 1:07 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] Search API and Scoring Fragment Roots
I’ve fragmeneted my XML documents at a sub-document level.
<doc>
<sub-doc>…</sub-doc>
<sub-doc>…</sub-doc>
<sub-doc>…</sub-doc>
<sub-doc>…</sub-doc>
</doc>
I want to use the search API to get the scores of a query match on the sub-doc
fragments. For instance, one document might have a sub-doc that scores 72 and
another that scores 56 (using simple scoring here).
However, it appears as though only the highest scoring sub-doc is shown per
document. If there are two (or more) sub-docs that score the same, they’re
shown, but that’s the only case.
I need to see the scores of all of the sub-docs that contain “hits” for each
document (assuming their score falls within the top X results, where X is the
page-length).
Is there a way to do this, or is the only way to get it to happen to actually
make the sub-docs into documents?
Thanks,
David Steiner
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general