Not really sure what you're getting at, but I'm assuming you mean searching for specific syntax or language aspects.
GitHub's definitely not "protecting" shit; it's just that search is a hard problem, and searching code is a really hard problem, at least at the scale they're at. They're running one of the largest Elasticsearch clusters in the world, and a lot of significant things in code are stop words (or not words at all) in most search databases. Not to mention you need to invalidate entire repo indexes when you force push, etc. It just takes a lot of resources, and like anything, will get better over time.