// search for "hello" and "apache"

SELECT url,last_mod,length,SUM(frequency) As FrequencySum,
COUNT(documents.id) As DocumentCount
FROM words,word_frequencies,documents
WHERE (word = 'apache' OR word = 'hello')
 AND documents.id = doc_id
 AND words.id = word_id
GROUP BY documents.id
ORDER BY DocumentCount DESC,FrequencySum DESC;

// Return words that sound like coan

SELECT word
FROM words
WHERE (soundex_code = SOUNDEX('coan');
