Geert,
I've seen you mention this a couple of times, and I got a little curious
this time. I ran a little test, with the finding that
cts:search(doc()//para, ...)
and
cts:search(doc(), ...)//para
are not equivalent. The first search will return only those para
elements for which the cts:query is true (whether this is done using
indexes if possible or always through filtering I'm not sure); the
second will return all para elements within any document for which the
search terms are true. Would you please clarify what you mean by this?
You obviously have a much deeper understanding of Mark Logic than I do,
so I want to understand what you are trying to say.
The test I ran uses a simple document that looks like this:
<doc>
<para>
<foo>1</foo>
</para>
<para>
<foo>2</foo>
</para>
</doc>
Then I executed the following two searches:
1.
cts:search(fn:doc()//para,
cts:element-value-query(xs:QName("foo"), "1") )
2.
cts:search(fn:doc(), cts:element-value-query(xs:QName("foo"),
"1") )//para
with the following results:
1.
<para>
<foo>1</foo>
</para>
2.
<para>
<foo>1</foo>
</para>
<para>
<foo>2</foo>
</para>
Of course, I didn't define any fragment roots, so the whole document is
a single fragment.
Doug Glidden
Software Engineer
The Boeing Company
[email protected]
_____
From: Geert Josten [mailto:[email protected]]
Sent: Monday, August 10, 2009 08:30
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] RE: Multiple Results Retreived
Hi Vivek,
The cts:search searches in fragments, and selects subelements as
expressed in the searchable XPath only afterwards. I recommend using the
following expression instead, just for clarity. It is equivalent:
cts:search(doc(), ...)//para
If you intend to limit the searching to within the para element, you
should use element-query constructors instead.
HTH..
Kind regards,
Geert
Drs. G.P.H. Josten
Consultant
<http://www.daidalos.nl/>
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
<http://www.daidalos.nl/> www.daidalos.nl
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u
dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te
verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general