fixed bug whereby search criteria was not correctly adjusted based upon document type