Archives For search

I suspect people commonly underestimate what’s required of a good Web site search engine. Some developers probably think that you just create a search box and then use the supplied terms in a database query to get the results. But there are actually three aspects to a search engine:

  • The index of the content to be searched
  • The act of actually performing the search
  • The reporting of the search results

Many people, I believe, only really think about these last two, but it’s really the index that’s key to the success of any search engine, just like a good index at the back of a book makes it possible for a reader to quickly find what they’re looking for.

As far as search engines go, the gold standard is Apache Lucene. Lucene has been a reliable and popular search engine of choice for years now. Although Lucene is written in Java, the Zend_Search_Lucene module, part of the Zend Framework, is a great PHP port of the software. [intlink id=”790″ type=”post”]In a previous post[/intlink], I explained how to integrate Zend_Search_Lucene into a Yii-based Web application. The focus in that post is really on getting the two different frameworks to work together. This is easily accomplished for two reasons:

  1. Yii supports third-party tools nicely
  2. The Zend Framework can be used piecemeal

So that previous post on Yii and Zend_Search_Lucene walks you through the Yii Controller and View files you’d create to perform a search and report upon the results, something that Zend_Search_Lucene does easily. Creating the index itself is the actual challenge, then, and one that I don’t feel is adequately documented elsewhere. In this post, I explain how to use Zend_Search_Lucene to create a search index of a site.

Continue Reading…

I’m just not a big fan of using the Zend Framework as my Web development tool, but one of the framework’s nicest features is that you can use only the parts of it you need. I am, however, a big fan of the Yii framework and one of its many plusses is that you can easily integrate other frameworks and tools into it. Like, for example, the Zend Framework. Yii does not have its own search engine functionality, and Apache’s Lucene is arguably the gold standard (although clearly not the only choice), so tapping into Zend’s Lucene module for a Yii-driven site makes a lot of sense. In this post, I’ll walk you through the steps for integrating  Zend_Lucene into Yii. This post does assume familiarity with PHP, MVC, and Yii. Continue Reading…