Hi Helen,

Are you doing this and it is too slow or are you just worried it will be slow?

Did you try combining the special note as a cts:query constraint to your 
search?  You did not say if you have markup to show your special note, but 
assuming you do, and if special-note is in a special-note element, something 
like:

cts:search(collection(), 
          cts:and-query((
             $query, 
             cts:element-query(xs:QName("special-note"), 
                               cts:and-query( () ) )) ) ) 

Or you can try filtering it out in a where clause of a FLWOR.

To really answer the question, I think you have to try some things out and see 
how well they work.

-Danny

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Helen Chen
Sent: Wednesday, November 25, 2009 8:19 AM
To: [email protected]
Cc: Helen Chen
Subject: [MarkLogic Dev General] questions about the search

I got a search situation as the following:

User passes me the search condition parameters, like search based on author
name, keywords, or anything user like. The search returns the list of document
records.  Then from these document records, I need to find out the first 200
items of special notes, some articles may not have special notes, some articles
may have more than 1 special notes. The requirement is: I need to return the
first 200 special notes no matter how many document records I have to go
through. So I cannot put pagination on the search result.

I have a concern: if the search is very wide range and the search returned a
large list of document records, let's say search returned 3000 document records,
then I need to loop through these 3000 records until I found 200 special notes.

The search returns document records, does that mean once search returned, these
document records are in memory?

Or if not in memory, does that mean if I only looped from 1 to 200 document
records and then stop the loop, then the rest 2800 document records won't affect
the memory?

No matter what, reading 200 document records into memory for one search is a
lot, is there any other ways that I can do to improve the search?

Any thoughts and ideas are appreciated.

Thanks, Helen

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

Reply via email to