Added some search code which was got from gnote.