Hi kelly,

        What is database order and relevance order? what is the 
difference?

Santhosh Rajasekaran
Tata Consultancy Services
Mailto: [email protected]
Website: http://www.tcs.com
____________________________________________
Experience certainty.   IT Services
                        Business Solutions
                        Outsourcing
____________________________________________



Kelly Stirman <[email protected]> 
Sent by: [email protected]
05/18/2009 05:21 PM
Please respond to
General Mark Logic Developer Discussion <[email protected]>


To
"[email protected]" <[email protected]>
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" <[email protected]>
Subject: [MarkLogic Dev General] How to search plural documents by
                 using           XPath.
To: <[email protected]>
Message-ID: <7d68896c51664e35b4ad353578276...@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
[email protected]
http://xqzone.com/mailman/listinfo/general


End of General Digest, Vol 59, Issue 21
***************************************
_______________________________________________
General mailing list
[email protected]
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


_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to