added totalHits on result set context and added more tests