Only add the cts:element-value-query() to your cts:query object if 
"$effect eq 'spec'". In other words, do the comparison outside the 
cts:query, and build a different cts:query depending on the value of the 
variables.

John

On 16/04/12 16:21, Gary Larsen wrote:
> Hi
>
> I’m trying to convert a query to use cts for performance. Is there a cts
> constructor that I can use the check a variable?
>
> Here’s a portion of the query:
>
> xdmp:directory('/db/netvisn/audit_history/','infinity')
> /nv:auditHistory
> [fn:not(fn:exists($oc)) or$oc =nv:lookupInfo/nv:objectClass]
> /nv:audit
> [$effect ne'spec'ornv:sync/nv:archived]
> [$effect ne'security'ornvdiff:diff/nv:content/nv:crnData8[nv:policies
> ornv:members]]
>
> For example I would like to turn this portion into a cts:or-query
>
> $effect ne'spec'ornv:sync/nv:archived
>
> For second part I can use a cts:element-value-query(). I need something
> for the first part.
>
> Or maybe I’m looking at this all wrong. Thanks for any suggestions.
>
> Gary
>


-- 
John Snelson, Lead Engineer                    http://twitter.com/jpcs
MarkLogic Corporation                         http://www.marklogic.com
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to