2. What functions or libraries are available to make such searching easy to implement well?
the tsearch2 module does that, and has a substantial advantage over a solution you might reimplement : it's already done (and it works). Try it...
---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster