If you have a web application with lots of records, is it a bad idea to use Google Search on your website? Instead of writing a search function and dealing with performance issue, you 'outsource' the search feature to Google.
As JCL1178 mentioned in their answer, Google will only return results for what it has indexed. Not only does this mean that some of your results may never appear, but if your site is ever de-indexed for some reason, you've lost the search from your web site. Having something as important as search rely on an unsupported 3rd party service is dangerous.
Since you have direct access to the data, you can provide a much better, more fine-grained search than Google or any other search engine can. You can allow your users to search specific fields, filtering out any other hits from unrelated fields. Google doesn't have any context to the values it's searching for, so a search for the "Smith" family could bring up any results for people living on "Smith St." or someone with the occupation of "blacksmith".
Most of the popular relational databases come with the ability to do full-text searches, so adding a basic search feature could be as simple as writing a few SQL statements.
I use Google Custom Search Engines for general search on my websites, but I wouldn't use it to search information that's stored in a database, unless my ability to do full-text searches was limited (software limitations, performance issues due to hardware/size of data set). It does depend on how complex your data is, and how important search is in navigating your data... but providing your own search facilities seems like the safest bet to me.
Outsourcing your search to Google Custom Search is not a bad idea but it may not be the best fit for your site/business model/whatever due to Google's limitations and rules.
The Custom Search is essentially the same thing as typing
search terms site: yoursite.com into Google except you don't have to specify the
site: yoursite.com part and you can embed a search form on your site. Site Search is a non-free version of Custom Search with more customization options and some access to the API. There are some other differences between Custom/Site Search and using Google proper that are explained in the linked documentation but the important thing to note is that they only work with what Google can see.
So the "lots of records" in your web application has to be fully able to be spidered by Google in order for Custom Search to really return accurate results. If you limit/protect the records from public viewing for any reason you either have to show Google the same limited results a logged-out user would see or you can have Google index the full content but then you must abide by the First Click Free rules or risk getting eaten by an angry Panda. If you present one thing to Google and another to visitors, that's Cloaking and you'll generate a penalty for your site. If all of the records you want included in search results are not able to be spidered for whatever reason, then using Google Custom Search or Site Search is not a good idea for your particular model.
But if you can allow everything to be indexed, you don't mind how Google returns the search results for Custom Search (or are unwilling to pay for Site Search to fix that), and are willing to risk having a critical page not get indexed for whatever reason, then you can and should should seriously consider it.