Search gets passed in a cursor for the database instead using an implicit global one