Keep current order

SearchOrder=[1,2,3,4]
Indicate 1 to “Sort by relevance,” 2 to “Sort by date ascending,” 3 to “Sort by date descending.” The default is 1. SearchView also supports a SearchOrder value of 4 to “Keep current order,” which sorts the resulting set of documents in the order in which they appear in the view.

(from URL commands for searching for text, Notes Designer Help database)

Don’t let the “Keep current order” option mislead you. The resulting set is what comes after selecting the documents that match the search query (SearchOrder=1) and cutting out all the documents outside the range [Start, Start + Count – 1]. So, whatever the order in which they appear in the view, any page of documents is all messed up.

This is a bug that only shows up when searching views and paging the result set, i.e. almost always when searching views, i.e. almost always when searching. At any new page request, either with the same query or not, Notes conducts a brand new search, where the resulting set is sorted in a most-relevant-to-Notes way, if SearchOption=4 was specified. Then Notes extracts all the Count documents beginning from Start, and finally shows them in the order in which they appear in the view.

It could be said that “SearchOrder=4” has a resulting-page scope, as opposed to a resulting-view scope.

(revised text from my own comment 12067686 at Experts-Exchange)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.