[MarkLogic Dev General] search:search options constraints
Steiner, David J. (LNG-DAY)
David.J.Steiner at elsevier.com
Thu Mar 25 11:20:41 PST 2010
I have an XML structure like this:
<text>This is a bunch of text that I
want to search.</text>
I want to search for words (multiple terms: word1 AND word2 AND word3)
in the <text> element of the <p> elements where the <ref:anchor>@id
starts with the string "para_".
<text> elements appear elsewhere and <p> elements do to... and there
are other types of id values, such as "subpara_..."
I'm trying to use search:search and I see how to constrain to a specific
element or attribute (or collection, etc.), but how do you do more
complex things - i.e., constrain to a specific element under a specific
parent where a sibling's attribute starts with a particular string?
Hopefully I've been clear - the XPath of the element I want to search:
// p[starts-with(ref:anchor/@id, "para_")]/text
Consulting Research Scientist
Global Architecture & Research iLabs
david.j.steiner at lexisnexis.com
Toll Free: 800-227-9597 ext. 51894
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the General