Used Brains And Black Plague, On eBay

He he. Chuckle, chuckle. Thanks to Kris and Brett for these pics. They ads are still there now when I search Google for used brain or black plague. My question is: does eBay just submit bulk lists of terms they want to buy, or do they have a deal with Google to just link ’em […] » about 100 words

Doing Relevance Ranked Full-Text Searches In MySQL

I’m going out on a limb to say MySQL’s full-text indexing and searching features are underused. They appeared in MySQL 3.23.23 (most people are using 4.x, and 5 is in development), but it’s been news to most of the people I know.

Here’s the deal, the MATCH() function can search a full-text index for a string of text (one or more words) and return relevance-ranked results. It’s at the core of the list of related links at the bottom of every post here.

For that query, I put all the tag names into a single variable that might look like this:

$keywords = “mysql database php select full-text search full-text searching docs documentation”

Then I do a select that looks something like this:

SELECT * FROM wp_posts WHERE MATCH(post_title,post_content) AGAINST(‘$keywords’);

The docs give a lot more detail, including how to do boolean searches.

Tags Tags Tags

David Weinberger at Many-to-Many pointed me to Tom Coates’ post about different schools of thought regarding tags. Coates has been thinking about tags as keywords, annotations. Thats how I’ve been using and thinking about tags too, but some people have different ideas.

…At the end of the argument I said to Joshua that it was almost like he was treating tags as folders. And he replied, exasperated, that this was exactly what they were.

Exasperation aside, Coates is pretty sure that Joshua’s view is loosing currency and the keywords view is growing.

Wienberger offers this explanation: we use tags as folders to organize things for ourselves, but we use tags as keywords as a way to contribute to the social understanding of things. That’s what Yahoo’s Social Search is trying to leverage.

Related: Google’s War On Hierarchy.