Varun,

I sounds like you are running many searches (one per result) rather than one 
search, which will be N times slower, or worse.

You can use the transform=raw option in search:search() to return the entire 
document, then use XPath to find the portion you want, or build a custom 
transform to return the section you want.

Alternatively, since you have already figured out cts:search() (nice work) you 
can use that directly. cts:search underlies search:search() and is less 
sophisticated but naturally returns portions of documents rather than 
fully-formed search result structures.

If you post a working query we can give more specific advice.

Yours,
Damon

--
Damon Feldman
Sr. Principal Consultant, MarkLogic


From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Varun Varunesh
Sent: Monday, February 18, 2013 12:01 PM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] (no subject)

Hi All,
I have written one search xqy which basically returns me a XML document. My ML 
database contains XML documents which structure is predefined i.e. like this
<sec name=" ">
      sec data
<\sec>

What i did it.....
1)  I am first searching for those document in my database which contains the 
searching string using search:search()
2)  Then for each document returned by search:search(), I am using cts:search() 
to take only that section in my result....
But this xqy is taking more time as we are expecting. Is there any other way to 
do this...?

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

Reply via email to