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.

\[intlink id="790" type="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

\[intlink id="1578" type="page"\]\[/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?

Without a registration system, the best way to allow customers to access their orders is by creating a pseudo-login, using information that would be unique to the customer and not publicly known. Logical options include any of the following: the customer’s email address, the order number, the order amount, the order date, the shipping zip code, and so forth. For example, using the email address and order number are the most practical choices. Simply create a form that takes these two pieces of information. Validate that the email address is of the proper email address format (perhaps using the Filter extension) and that the order number is a positive integer. Then, if both pieces of data passed the validation tests, you’d do a SELECT query like

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.