moved all the code for document search into documentsearch class