It's even more surprising when you consider that an identical result
to your intended:
cts:search( (doc('/1.xml'), doc('/2.xml'))/hw:doc/a:entry, $query)
could be had using
cts:search(/hw:doc/a:entry,
cts:and-query ((
cts:or-query((cts:document-query('/1.xml'),
cts:document-query('/2.xml'))),
$query))))
(at least I think so - haven't tried it)
but I guess the automated query analysis isn't up to that kind of
transformation yet...?
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> James A. Robinson
> Sent: Wednesday, September 10, 2008 4:08 PM
> To: [email protected]
> Subject: [MarkLogic Dev General] cts:search $expression
>
>
> The cts:search() function takes as its first argument an
> $expression which the documentation indicates "must be a
> fully searchable path expression."
>
> Playing around with what this $expression could be, I found
> that, given a $query
>
> cts:element-attribute-value-query(
> xs:QName("a:category"),
> xs:QName("term"), "http://schema.highwire.org/Journal",
> ("lang=en"), 1)
>
> I couldn't run a search using an $expression of two doc() calls:
>
> cts:search(
> (doc('/1.xml'), doc('/2.xml'))/hw:doc/a:entry,
> $query)
>
> And yet
>
> cts:search(
> xdmp:directory("/", "1")/hw:doc/a:entry,
> $query)
>
> works fine. This surprised me.
>
> What I was really trying to do was run something like
>
> cts:search(
> (doc('/some/path/id.xml'),
> xdmp:directory('/some/path/id/',
> 'infinity'))/hw:doc/atom:entry,
> $query)
>
> But I found I had to split it up into two separate cts:search queries.
>
> Jim
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> James A. Robinson [EMAIL PROTECTED]
> Stanford University HighWire Press http://highwire.stanford.edu/
> +1 650 7237294 (Work) +1 650 7259335 (Fax)
> _______________________________________________
> General mailing list
> [email protected]
> http://xqzone.com/mailman/listinfo/general
>
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general