[MarkLogic Dev General] RE: How to search plural documents by
Santhosh Raj
santhosh.raj at tcs.com
Mon May 18 05:33:57 PDT 2009
Hi kelly,
What is database order and relevance order? what is the
difference?
Santhosh Rajasekaran
Tata Consultancy Services
Mailto: santhosh.raj at tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
Kelly Stirman <Kelly.Stirman at marklogic.com>
Sent by: general-bounces at developer.marklogic.com
05/18/2009 05:21 PM
Please respond to
General Mark Logic Developer Discussion <general at developer.marklogic.com>
To
"general at developer.marklogic.com" <general at developer.marklogic.com>
cc
Subject
[MarkLogic Dev General] RE: How to search plural documents by
XPath expressions are evaluated against all documents in a MarkLogic
database:
/foo/bar
Will return all elements bar that are children of documents with a root
node of foo.
collection("my-collection")/foo/bar
Will return all elements bar that are children of documents with a root
node of foo that belong to the collection "my-collection."
xdmp:directory("/my-directory/","infinity")/foo/bar
Will return all elements bar that are children of documents with a root
node of foo that are in a directory called "/my-directory/" or any of its
descendent directories.
One difference between cts:search() and XPath is the ordering of
documents. XPath returns documents in database order, whereas cts:search()
returns documents in relevance order. It is possible to order your
expressions by other values, but to do that you will need a FLWOR
expression.
Finally, you can add cts:query constraints to your XPath expressions using
cts:contains():
xdmp:directory("/my-directory/","infinity")/foo/bar[cts:contains(.,cts:and-query(("blue","red")))]
Will return all elements bar that are children of documents with a root
node of foo that contain the words "red" and "blue" that are in a
directory called "/my-directory/" or any of its descendent directories.
Results will be returned in database order.
Hope this helps.
Kelly
Message: 3
Date: Mon, 18 May 2009 20:38:23 +0900
From: "Yasumasa Shigemoto" <shigemoto.yasum at jp.fujitsu.com>
Subject: [MarkLogic Dev General] How to search plural documents by
using XPath.
To: <general at developer.marklogic.com>
Message-ID: <7D68896C51664E35B4AD353578276B27 at FBIO001742BF1332>
Content-Type: text/plain; format=flowed; charset="iso-2022-jp";
reply-type=original
Hi all,
I have used MarkLogic for two weeks, and I have managed to use XQuery
against one XML document. And I could also use cts:search against plural
XML
documents. However I would like to search against plural documents by
using
XPath. Can I do it by using both cts:search and XQuery? If yes, could you
tell me the examples of XQuery and XML documents?
Thanks and regards,
------------------------------
_______________________________________________
General mailing list
General at developer.marklogic.com
http://xqzone.com/mailman/listinfo/general
End of General Digest, Vol 59, Issue 21
***************************************
_______________________________________________
General mailing list
General at developer.marklogic.com
http://xqzone.com/mailman/listinfo/general
ForwardSourceID:NT0000BACA
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20090518/5e4e5e1b/attachment.html
More information about the General
mailing list