Remove falsey haystacks before searching for the needle

Prevents slaves with missing surnames from matching the query "name is like 0".

From comments on !8115 (merged)

Merge request reports

Loading