implement search query that actually selects instead of pulling all