implemented search for documents