You can try cts:element-query() instead of cts:element-word-query(), but
your index configuration may affect the performance of this function and
your ability to use xdmp:estimate() instead of fn:count(). This assumes
version 3.x of MLS as this feature was not available in 2.x.

Kelly

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Saturday, September 16, 2006 3:00 PM
To: [email protected]
Subject: General Digest, Vol 27, Issue 3

Send General mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://xqzone.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. cts:element-word-query() (Shannon Shiflett)
   2. Re: cts:element-word-query() (Jason Hunter)


----------------------------------------------------------------------

Message: 1
Date: Fri, 15 Sep 2006 17:13:39 -0400
From: Shannon Shiflett <[EMAIL PROTECTED]>
Subject: [MarkLogic Dev General] cts:element-word-query()
To: General XQZone Discussion <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Hi,

I have two queries that (in theory?) should return the same thing but:

count(collection("PGWDE")//tei:div1[cts:contains(.//tei:note,  
cts:word-query("boston"))])

returns 953

however,

count(cts:search(collection("PGWDE")//tei:div1, cts:element-word-query 
(xs:QName("tei:note"), "boston")))

returns 0

Same database.  Can anyone guess why?  In Virginia it's too late in  
the day to figure this out....

Thanks!

Shannon
UVA Press


------------------------------

Message: 2
Date: Fri, 15 Sep 2006 14:40:48 -0700
From: Jason Hunter <[EMAIL PROTECTED]>
Subject: Re: [MarkLogic Dev General] cts:element-word-query()
To: General Mark Logic Developer Discussion
        <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Shannon,

The probable reason is cts:element-word-query() does a shallow look, 
while cts:contains() does a deep look.

A cts:element-word-query() only looks at direct text node children. 
(Well, and any other text node children configured to be seen by 
something like element-word-query-through).  A cts:contains() looks at 
all children at any depth.

-jh-

Shannon Shiflett wrote:
> Hi,
> 
> I have two queries that (in theory?) should return the same thing but:
> 
> count(collection("PGWDE")//tei:div1[cts:contains(.//tei:note, 
> cts:word-query("boston"))])
> 
> returns 953
> 
> however,
> 
> count(cts:search(collection("PGWDE")//tei:div1, 
> cts:element-word-query(xs:QName("tei:note"), "boston")))
> 
> returns 0
> 
> Same database.  Can anyone guess why?  In Virginia it's too late in
the 
> day to figure this out....
> 
> Thanks!
> 
> Shannon
> UVA Press
> _______________________________________________
> General mailing list
> [email protected]
> http://xqzone.com/mailman/listinfo/general
> 


------------------------------

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


End of General Digest, Vol 27, Issue 3
**************************************
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to