help,when i use “notesDatabase.Search( formula$, notesDateTime, maxDocs% )” to search document in database,it is start search by document create time order by ascend.it is mean if i have 200 documents,100 is newly and 100 is older,if i use maxDocs=100 to cut off,it always show 100 documents which is older,how can i start with document create time order by descend,if i use maxDocs to cut off it is show documents which is newly.
Subject: You’ll need to sort the collection with code
Also note, using maxDocs will not increase performance if you set it to 100 or return all results, as maxDocs doesn’t actually work the way you expect
See this entry I made on my blog a while back when I was having frustrations with it.
Subject: RE: You’ll need to sort the collection with code
thanks a lot,it is means i should loop the colletion form the last?
or is there the way to change the colletion order by ascend to order by descend?
Subject: RE: You’ll need to sort the collection with code
you should not depend on it always coming in the order you expect. You should sort the collection with the criteria you want, based on a field value or whatever.
Subject: RE: You’ll need to sort the collection with code
how to orderd a notesDocumentCollection as default the notesDocument is unordered when use database.search()
Subject: RE: You’ll need to sort the collection with code
Either write your own sorting routine for NotesDocumentCollection , or use somebody else’s routine. Lots of people have done it! Google “sort NotesDocumentCollection” and you will find plenty of examples, including these two: Don McNally: SnTT: Sorting a NotesDocumentCollection - Ascending *or* Descending
http://openntf.org/Projects/codebin/codebin.nsf/CodeBySubType/05E4F4DADC24F96186256DE300486CB3