Search Engine
Date: Fri, 1 Nov 2002 16:54:09 -0000
Message-ID: <apubkk$n86$1$8300dec7_at_news.demon.co.uk>
I am trying to design a search engine. Im building a prototype in access 2000 to index urls. I have the following:
Each URL has many keywords. A keyword could be related to more than one URL. I want to run a search that returns urls given a list of keywords to search on.
- = pri key table Keyword(*ID, Keyword) table URL(*ID, URL) table URL_Keyword(*ID, fk_Keyword, fk_URL)
URL 1----M URL_Keyword M-----1 Keyword
search query:
SELECT URL.URL, Count([keyword].[id]) AS Hits
FROM URL INNER JOIN (Keyword INNER JOIN URL_Keyword ON Keyword.ID =
URL_Keyword.fk_Keyword) ON URL.ID = URL_Keyword.fk_URL
WHERE Keyword.Keyword= [Search1] or keyword = [Search2] or ..........etc
GROUP BY url.url
ORDER BY Count([keyword].[id]) DESC;
Have i got the right idea? or is there a more efficient way to do this?
I could add a description field to url then use KeyWordInContext (finding keywords delim by spaces) to an entry to Keyword (I should not use 'index' It could confuse).
Thoughts?
Cheers
Stu
Received on Fri Nov 01 2002 - 17:54:09 CET