Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Content with Style:
Fulltext searches with Xapian and PHP
Nov 04, 2009 @ 14:19:13

New on the Content with Style blog today there's this tutorial looking at full-text searching combining Xapian and PHP to replace the slower full-text methods in something like a MySQL database.

Sometimes MySQL just isn't quick enough. Especially when it comes to fulltext searches. Everything needs to be indexed correctly, and if we're using different fields with different weights for a relevance percentage, things get very complicated quickly. Xapian to the rescue.

The Xapian library can be compiled and installed as a binding for your PHP installation. He includes some sample scripts to get you started - the SQL to build the table, a Xapian wrapper class, and three simple PHP scripts to search for, view and delete records. Some sample results are also included.

tagged: fulltext search xapian mysql database tutorial

Link:

Community News:
Forage - A Search Abstraction Layer
Feb 08, 2008 @ 17:16:00

A different sort of abstraction layer project has been started up and has already seen a few releases - Forage. As mentioned on Rob Young's blog:

Recently I've been working on a search abstraction library for PHP called Forage. The idea is to bring to search what we've had for relational databases for quite a while, abstraction.

On Friday I put up a preview release with three backends; Solr, Xapian and Zend Search Lucene. At the moment it has the bare minimum of features but there will be more soon. In this post I'm going to talk a little about the motivation for the project and then walk through a short example.

He talks about the need for search abstraction (integration and resilience to change) before getting into an example of some code that grabs the data from an RSS feed, passes it in to the Xapian search engine and stores it before looking it over for thier search terms ("yahoo microsoft").

You can download the library if you'd like to try it out for yourself.

tagged: search abstraction layer project xapian zendlucene solr

Link:


Trending Topics: