search: refactor error types
Created by: rvantonder
Part 1 of stack for literal search with and/or operators. Splitting things up so that some of the easy PRs can be approved by anyone, not just search team.
This moves dedicated error types to types.go
and corrects the return type for some parser errors.