OpenGrok (https://github.com/oracle/opengrok) is a wonderful tool to search a codebase.
It runs on-prem and handles lots of popular programming languages.
OpenGrok is okay but I found livegrep (https://livegrep.com) to be less of a hassle and lighter. It's been some time since I used either regularly, though.
https://news.ycombinator.com/item?id=39993976#39996636