Implemented db.search()