Search of cases in the database