search: properly filter out non-preferred providers

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
search: implement short-circuiting to trim the output

Signed-off-by: Christopher Larson <chris_larson@mentor.com>