You can evaluate XPath and cts:queries against constructed nodes with 
cts:contains.

let $docs := for $i in (1 to 100) return document { element foo {$i}}
return $docs[cts:contains(foo,"1")]

I can't imagine a case where saving to the database would speed this up.

Kelly

Message: 2
Date: Thu, 5 May 2011 08:07:22 -0600
From: "seme...@hotmail.com" <seme...@hotmail.com>
Subject: Re: [MarkLogic Dev General] query for search in elements and
        attributes
To: <general@developer.marklogic.com>
Message-ID: <snt121-w29a223ab761e9bc5c349d9b7...@phx.gbl>
Content-Type: text/plain; charset="iso-8859-1"


Slightly off-topic question: what about when you are searching in-memory 
elements? Suppose I contructed 100 xml trees in memory that were each 1K (just 
for example), I put them in a sequence, and then I to use XPath against the 
sequences of trees to find all values of a particular attribute. None of the 
trees are in the db a consequently are not in the index. How does performance 
compare to a situation where these trees were saved as docs in the DB? Is there 
a point where for speed considerations you would want to save the trees to the 
DB just so they could be indexed?

Thanks,
Ryan
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to