There are several tools fitting this general description, but this writer has only found one turnkey installable. This is Yacy:
Very fast, quite straightforward to set up and configure (though you’ll learn a thing or two if you’ve never thought about search very much!), almost not at all counterintuitive. It can be easily set up as either a LAN-local search server or part of its distributed WWW network.
There is a runner up, Open Search Server:
If its documentation were remotely adequate, it might be comparable, but sadly, not.