You could try this in MarkLogic 6 and lower:

let $node := 
cts:uri-match("/docs/*.xml")[cts:contains(text{.},cts:not-query("COL"))][1 to 
10]
return $node

Cheers,
Geert

From: 
<[email protected]<mailto:[email protected]>>
 on behalf of Brent Hartwig <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Friday, February 19, 2016 at 2:44 PM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>, 
"Kapoor, Pragya" <[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] cts:contains in marklogic 5.0.3

Hi, Pragya,

I misinterpreted what you were trying to do the first time.  You’re trying to 
exclude some URIs returned from cts:uri-match().  Anyway, the answer is that 
cts:contains()’s signature changed between the two versions.

ML 5 (http://docs.marklogic.com/5.0/cts:contains) and ML 6:


cts:contains(

   $nodes<http://docs.marklogic.com/5.0/cts:contains#nodes> as node()*,

   $query<http://docs.marklogic.com/5.0/cts:contains#query> as cts:query

) as xs:boolean?

ML 7 (http://docs.marklogic.com/7.0/cts:contains):


cts:contains(

   $nodes<http://docs.marklogic.com/7.0/cts:contains#nodes> as item()*,

   $query<http://docs.marklogic.com/7.0/cts:contains#query> as cts:query

) as xs:boolean?

-Brent
Solutions Architect @ RSI
Skype: brent.hartwig
Mobile: 517.945.2132

From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Kapoor, Pragya
Sent: Friday, February 19, 2016 12:25 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] cts:contains in marklogic 5.0.3




But then how is this working on MarkLogic 7?

Thanks
Pragya
________________________________
From:[email protected]<mailto:[email protected]>
 
<[email protected]<mailto:[email protected]>>
 on behalf of Brent Hartwig <[email protected]<mailto:[email protected]>>
Sent: Thursday, February 18, 2016 5:39 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] cts:contains in marklogic 5.0.3


Hi, Pragya,



cts:uri-match() returns string identifiers to the documents, as opposed to the 
documents themselves.



You may want something more along the lines of cts:search().



-Brent

Solutions Architect @ RSI

Skype: brent.hartwig

Mobile: 517.945.2132



From:[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Kapoor, Pragya
Sent: Thursday, February 18, 2016 7:01 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] cts:contains in marklogic 5.0.3



Hi,



I am running below query in MarkLogic 5.0.3 and getting error while its running 
on MarkLogic 7.0



let $node := 
cts:uri-match("/docs/*.xml")[cts:contains(.,cts:not-query("COL"))][1 to 10]

return $node



Error:

[1.0-ml] XDMP-ARGTYPE: (err:XPTY0004) 
cts:contains("/docs/0000002-0000000-0000001-ISDA-COL-XXXX_2005-05-17_17-28-33-...",
 cts:not-query(cts:word-query("COL", ("lang=en"), 1), 1)) -- arg1 is not of 
type node()*



Stack Trace

At line 1 column 43:



1. let $node := 
cts:uri-match("/docs/*.xml")[cts:contains(.,cts:not-query("COL"))][1 to 10]

2. return $node

3.





"This e-mail and any attachments transmitted with it are for the sole use of 
the intended recipient(s) and may contain confidential , proprietary or 
privileged information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. Any 
unauthorized review, use, disclosure, dissemination, forwarding, printing or 
copying of this e-mail or any action taken in reliance on this e-mail is 
strictly prohibited and may be unlawful."
"This e-mail and any attachments transmitted with it are for the sole use of 
the intended recipient(s) and may contain confidential , proprietary or 
privileged information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. Any 
unauthorized review, use, disclosure, dissemination, forwarding, printing or 
copying of this e-mail or any action taken in reliance on this e-mail is 
strictly prohibited and may be unlawful."
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to