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

php|architect:
Full-text Search with SQLite
Nov 15, 2011 @ 09:53:50

On the php|architect site there's a recent tutorial from Jeremy Kendall about full-text searching in SQLite, a lightweight database alternative that, since it's stored locally, can be used without a full database server.

Full-text search with SQLite is so ridiculously easy to implement, there are only two valid reasons you haven’t done it yet. The first is you don’t need the full-text capability, and the second is you didn’t know it could be done.

In his method he creates a full-text search table (using fts4) and populating it with your data. You can use the "MATCH" keyword in your SQL to find the closest matches and even handy modifiers like "NEARBY", wildcards and token/prefixes in queries. For more detailed information, check out the SQLite documentation for a full guide.

tagged: fulltext sqlite search fts4 table

Link:

DZone.com:
MySQL PHP search: four-part video tutorial series
Oct 31, 2011 @ 13:09:29

As linked to on DZone.com today, there's a video series about PHP/MySQL and creating a basic search engine from Adam Khoury's collection:

Fresh from Adam Khoury's massive library of instructional videos comes a four-part, full-fledged tutorial on searching a MySQL database using PHP. The tutorials use the 'worked example' format (like Khan Academy), which makes learning relatively painless for newbies and not completely useless for more experienced developers.

The four videos require you to have at least a decent working knowledge of putting PHP and MySQL together and show you how to:

tagged: video tutorial series search union like fulltext mysql searchengine

Link:

Content with Style:
Fulltext searches with Xapian and PHP
Nov 04, 2009 @ 08: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:

PHPFreaks.com:
Simple SQL Search
May 08, 2009 @ 09:30:06

In a new article on PHPFreaks.com Brad Jacobs takes a look at creating a simple search of the information in your database. Their example will search a table containing article information (title, story content, etc).

The aim of this tutorial is to provide users with a basic layout and the logic behind creating a multiple field search in MySQL. As often time users tend to over do the search and add a lot of unnecessary code. By following and understanding this tutorial you should be able to implement this search into your own site and provide a nice and simple SQL Search of your own database. So roll up your sleeves and be prepared to get dirty.

Everything's provided for you - the SQL to build and fill the tables and the code to perform the search. They opted to go with LIKE statements in the where clause instead of using something like full-text searching. The former works for a lot of situations, but can get slower and slower the more rows there are in the table.

tagged: simple tutorial sql search mysql fulltext article content title

Link:

Antony Dovgal's Blog:
PECL/sphinx - fast fulltext search made easy
Jul 31, 2008 @ 15:14:08

Antony Dovgal has a quick post today about a PECL extension that makes for quick and easy full-text searching on standard SQL databases.

As some of you might have noticed, I've been a bit busy lately creating new PECL extension - sphinx. The extension provides an interface to a feature-rich fulltext search engine Sphinx written by Andrew Aksyonoff. We (Andrew and me) made our best to keep the extension as compatible to the pure-PHP API (shipped with Sphinx) as possible in order to make the transition easier.

The PECL page has already been created as well as a page in the manual for how it works. He also briefly mentions the installation (including teh required libraries).

tagged: pecl sphinx fulltext search sql extension install

Link:

Markus Wolff's Blog:
Fulltext search as a webservice
May 07, 2008 @ 12:57:47

In a recent blog entry about a fulltext searching solution, Markus Wolff hacked together in a few hours with Zend_Search_Lucene:

While working at some really old code that provided a fulltext search feature, I was at one point incredibly pissed rather unsatisfied due to the fact that said code resisted all attempts to debug it. This lead to the decision to sit down on a rainy weekend to try if I couldn't come up with something more useful, and most importantly, scalable.

His method allowed for separation between the indexing and the main app and how he changes some of his methods when he learned that Solr did something very similar. He also lays out some example XML content and how it's handled in his script (via a SimpleXML object).

tagged: fulltext search xml document zendsearchlucene zendframework solr

Link:

DevShed:
Performing Full-text and Boolean Searches with MySQL
Jun 06, 2007 @ 14:06:00

DevShed has started a new MySQL-centric series today with this new tutorial, an initial look at working with MySQL and PHP to perform full-text and boolean searches on your data.

In this series of articles I'm going to show you how to work with full-text and Boolean searches using MySQL and PHP 5, but the entirety of the code samples that will be developed here can be easily modified to work with a different database server.

They start with the creation of a "common approach" for making the requests and fetching the results (in classes so that any other database could be substituted). With the class structure in place, they move on to the full-text searches, showing how to format database tables by creating them with a fulltext index on which ever fields you want.

tagged: mysql boolean search fulltext table database tutorial mysql boolean search fulltext table database tutorial

Link:

DevShed:
Performing Full-text and Boolean Searches with MySQL
Jun 06, 2007 @ 14:06:00

DevShed has started a new MySQL-centric series today with this new tutorial, an initial look at working with MySQL and PHP to perform full-text and boolean searches on your data.

In this series of articles I'm going to show you how to work with full-text and Boolean searches using MySQL and PHP 5, but the entirety of the code samples that will be developed here can be easily modified to work with a different database server.

They start with the creation of a "common approach" for making the requests and fetching the results (in classes so that any other database could be substituted). With the class structure in place, they move on to the full-text searches, showing how to format database tables by creating them with a fulltext index on which ever fields you want.

tagged: mysql boolean search fulltext table database tutorial mysql boolean search fulltext table database tutorial

Link:

Developer.com:
Creating a Code Search Engine with PHP and MySQL
Apr 12, 2007 @ 09:30:00

Developer.com has posted a new tutorial by Jason Gilmore about the creation of a simple search engine based around a MySQL database and using PHP to perform the queries.

In this article I'll offer a simplified version of this search engine, introducing you to some compelling PHP and MySQL features along the way. You might adopt what you learn towards building your own search engine, or towards other applications.

He starts with the base of the application - the database schema (including loading data into it) - and works up from there. He opts to go with the fulltext search type as it can provide a huge performance boost over just using something like LIKE statements in your query. He also includes a bit of HTML for help make the output easier to use.

tagged: searchengine mysql fulltext html schema searchengine mysql fulltext html schema

Link:

Developer.com:
Creating a Code Search Engine with PHP and MySQL
Apr 12, 2007 @ 09:30:00

Developer.com has posted a new tutorial by Jason Gilmore about the creation of a simple search engine based around a MySQL database and using PHP to perform the queries.

In this article I'll offer a simplified version of this search engine, introducing you to some compelling PHP and MySQL features along the way. You might adopt what you learn towards building your own search engine, or towards other applications.

He starts with the base of the application - the database schema (including loading data into it) - and works up from there. He opts to go with the fulltext search type as it can provide a huge performance boost over just using something like LIKE statements in your query. He also includes a bit of HTML for help make the output easier to use.

tagged: searchengine mysql fulltext html schema searchengine mysql fulltext html schema

Link: