If you wish to change the order in which search results are returned, add this to the loadengine function:
viewer.SearchOrderBy = 'Date';
to order by most recent to oldest
viewer.SearchOrderBy = 'Page';
to order by page number
viewer.SearchOrderBy = 'Rank';
to order by relevance