added pre_get_all hook for relation searches