If you just want a class have a look at Zend framework which contains a port of Lucene
http://framework.zend.com/manual/en/zend.search.html I've only played with it rather than using it for a real project.
MySQL 4+ has full text search capabilities which you might find satisfies your needs
http://dev.mysql.com/doc/refman/5.0/...xt-search.html
If you're after a site search engine then have a look at
http://cs.ioc.ee/~ando/sphider/ I did play with it a while ago but never used it in anger.
Which is best all depends on what you are trying to achieve.