building a search engine

From: Date: Tue, 06 Aug 2002 02:32:32 +0000
Subject: building a search engine
Groups: php.general 
Request: Send a blank email to php-general+get-111315@lists.php.net to get a copy of this message
Hi, I've done a bit of a google on building a search engine, and found some nice stuff, but a helluva lot of crap (the guy on phpbuilder.com storing text in BLOBs was the funniest!!). Basically I'm at the very humble beginnings of being able to search a single table column for a single word or phrase. eg: <? $search_phrase = "foo" (or "foo bah") $sql = "SELECT * FROM whateverTable WHERE whateverCol LIKE '%{$search_phrase}%'"; ?> That's all fine, but I want to be able to deal with multiple words [splitting on space] and exact phrases [wrapped in quotes] (and combinations of the two) eg: 1. 'foo bah' split into two words, documents containing both get higher relevance 2. '"foo bah"' search for exact phrase (already have that working) 3. 'foo "foo bah"' combination of 1 and 2 I'm also keen to learn about grading relevance across multiple tables, multiple columns, etc etc. It seems like a HUGE task, but I'm probably missing some key MySQL feature, or some trick that makes everything easier. If someone could point me to the RIGHT tutorials/articles or manual pages, or drop a few hints I'd be greatful -- but i'm not after a huge chunk of code at all -- just the theory. Justin French

« previous php.general (#111315) next »