I have no technical info on how it works exactly but I’d imagine that the search function uses an indexed database and thus it requires more than just a simple script. But, there are plenty of other ways to add a search to your own website. Check out these Google results for example. Good luck!
I guess you can place a simple HTML form on your site for adding the search function.