ITS#10041 Restrict group searching
If only dynamic list or 'member'-type values are requested, we can trim the candidate entries down according to the rest of the filter. This code does just that (it might be possible to optimise the filter handling further).