updated the sqlite search method to do the random filtering on the db side rather than the code side.