fix debug condition. fix search filter so that each set of results is output in a separate group