Trainer / Instructor UNIX C++ / C Senior-Hands On Programmer-WSI
WSI Nationwide, Inc.
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Dynamic Document Search Engine - Part 2
Introduction:
In part 1, the article discussed document based searches that display results based on the number of search words found in each document. This article is an extension that ranks based on number of search words found plus number of occurrences of each search word in the document.
To search for “php tutorials and examples”, the following table shows the title and occurrence of each search word in the document. Common words like is, was, and etc. are removed from the search constraints by the program. So in this example, we have three search words, ‘php, ‘tutorials’ and ‘examples’.
No.Article NumberphpTutorialExamplesTotal OccurrenceRank
1.Article #189151116423
2.Article #20325128451
3.Article #25718165394
4.Article #1456817315
5.Article #52651721432
6.Article #8614410286
Article #203 has the highest occurrence and it is given rank 1. Similarly ranking is given for other results.
Building The Database:
The database consists of three tables. Document Table, Keyword Table and Link Table. Document Table holds article’s title, and abstract. Keyword Table holds keyword and the keyword field is indexed. Link Table holds keyword id, content id, and occurrences.
The SQL Statement for creating these three tables are shown below.
Content Table:
CREATE TABLE content ( 
contid mediumint NOT NULL auto_increment, 
title text NOT NULL, 
abstract longtext NOT NULL, 
PRIMARY KEY (contid) 
) TYPE=MyISAM; 
Keyword Table:
CREATE TABLE keytable ( 
keyid mediumint NOT NULL auto_increment, 
keyword varchar(100) NOT NULL,
PRIMARY KEY (keyid), 
KEY keyword (keyword) 
) TYPE=MyISAM; 
Link Table:
CREATE TABLE link ( 
keyid mediumint NOT NULL, 
contid mediumint NOT NULL,  
occurances mediumint NOT NULL 
) TYPE=MyISAM; 
[ Next Page ]


Comments:
RE: Dynamic Document Search EngineMatt Langley12/12/04 22:20
RE: Dynamic Document Search Enginesaurab07/11/04 05:38
RE: Dynamic Document Search Enginedustin02/28/04 17:07
Dynamic Document Search EnginePaul Appleby02/26/04 14:41
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.