I have a search engine which scans all the words in a given web page and then shows their occurrence. Then they are ranked by the ranked by the amount of occurance the word appears in the document. But it doesn't return multiple term queries.
Below is my SQL Query. I would like to be able to have it check all the words inputted and then rank by the amount of times the words appear in the document. It is only working for single term queries at the moment.
$result = mysql_query(" SELECT p.page_url AS url,
COUNT(*) AS occurrences
FROM page p, word w, occurrence o
WHERE p.page_id = o.page_id AND
w.word_id = o.word_id AND
w.word_word = \"$keyword\"
GROUP BY p.page_id
ORDER BY occurrences DESC
LIMIT $results" );