[MarkLogic Dev General] RE: search:search options constraints
Steiner, David J. (LNG-DAY)
David.J.Steiner at elsevier.com
Thu Mar 25 13:24:12 PST 2010
Right, that's actually what I'm looking for - how to do what I want
using the search API, not XPath.
From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Stewart
Shelline
Sent: Thursday, March 25, 2010 4:33 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] RE: search:search options constraints
Another way to do this is in the <additional-query> element of
search:search. You can use it to build complex queries using any of the
cts:query functions-assuming you have the appropriate indexes set up.
From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Keith L.
Breinholt
Sent: Thursday, March 25, 2010 1:34 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] RE: search:search options constraints
// p[starts-with(ref:anchor/@id, "para_")]/text[fn:contains( "sometext",
.)]
Keith L. Breinholt
breinholtkl at ldschurch.org
From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of Steiner,
David J. (LNG-DAY)
Sent: Thursday, March 25, 2010 1:21 PM
To: general at developer.marklogic.com
Subject: [MarkLogic Dev General] search:search options constraints
I have an XML structure like this:
...
<p xmlns="namespace1">
<ref:anchor id="para_2"
xmlns:ref="namespace2"/>
<text>This is a bunch of text that I
want to search.</text>
</p>
...
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
Thanks,
David Steiner
Consulting Research Scientist
Global Architecture & Research iLabs
LexisNexis Group
david.j.steiner at lexisnexis.com
Toll Free: 800-227-9597 ext. 51894
Direct: 937-865-1894
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20100325/075f65db/attachment.html
More information about the General
mailing list