search: achieve validation parity with existing queries
Created by: rvantonder
Stacked on #9752. This PR validates and/or queries in essentially the same way as our existing query logic. The main addition is function validateField, which does basically all the work of our existing searchquery.go definition constraints and check logic in check.go. The rest of the PR is basically just set up.
I have migrated validation tests from search_query.go where it makes sense, and added my own additional ones. See linked issue for further description.