Creating A Fulltext Search Engine In PHP 5 With The Zend Framework's Zend Search Lucene
Introduction
This article covers the implementation of a fulltext search engine using PHP 5 and the Zend Framework. We will be using the Zend_Search_Lucene component to create and search our fulltext index.
There are several other libraries we could use instead of this one, but Zend_Search_Lucene is completely native to PHP, whereas others such as Xapian or Tsearch2 rely on third party modules (for instance, the Tsearch2 module must be compiled into your PostgreSQL installation).
It must be noted at this point though that we require at least PHP 5 for Zend_Search_Lucene – PHP 4 will not work.
In this article we will be covering the following:
- How to index a document or series of documents
- The different types of fields that can be indexed
- Searching the index
To demonstrate this functionality, we will cover the implementation of a search engine into PhpRiot. We previously used the Tsearch2 module but had some problems that we were unable to overcome.
