Validate search input