search db with list of ids