Larry Ullman

Translating Geek Into English

Creating a Search Index with Zend_Search_Lucene

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.

What is Larry Thinking? #32 => E-Commerce and Time for a Change

In this edition…

About This Newsletter

What I’m most proud about this newsletter is that I actually sent it out three weeks (to the day, well, almost) after the previous one, which is the schedule I theoretically intend. In fact, a rough draft of the newsletter was completed a week ago! I was largely able to do this because I don’t have any deadlines at the moment, and partially because I’m (finally) getting more organized with the newsletters.

Effortless E-Commerce: Allowing Customers to View Old Orders

In the second demo site for my book “

\[intlink id="1578" type="page"\]

Effortless E-Commerce with PHP and MySQL

\[/intlink\]

”, customers are able to make purchases without logging in. Although this isn’t a standard approach for many e-commerce sites, it’s actually a better way to go in terms of increasing profits. Simply put, requiring registration will inevitably hurt sales. I know there have been times when I stopped going through with a sale because I didn’t feel the need to register at a site I’m not likely to shop at again. But without a login system, it’s a bit more challenging to let customers view previous orders (e.g., to check the status of an existing order or to review older orders). There are two solutions.

The first solution is to provide a registration option. Then registered users could login and see existing orders but other customers could place orders without having to register. But what if you wanted any customer to be able to view their orders?

The Carrington WordPress Framework

For some time now I’ve been planning on doing a major overhaul of the DMCInsights.com Web site. I have many goals for the revised site:

  • A simpler, cleaner design, better for presenting long blog posts and code
  • Integration of the blog into the main site
  • Better promotion of my books

Over the past year I’ve flagged designs and designers that appeal to me, in the thought that I’d use a custom design for the site. As a last bit of research, before hiring a designer, I looked at available WordPress themes (WordPress is perfect for me as a content management tool). What I found, and what I’m using, is the Carrington WordPress Framework, and I’m so happy that I did.