#native_company# #native_desc#
#native_cta#

Dynamic Document Search Engine – Part 1

By M.Murali Dharan
on February 17, 2004

Introduction:

I started working with PHP six months ago. I used to read many articles in Internet that gave
me better understanding on PHP. I started developing software for ??Online Journals?? that has
the capability of searching document??s contents. You can find articles in devarticles.com that
can perform keyword title and author search. This article gives you a brief idea of
Document-Based Search.
What is Document Search?
In a Dynamic Document Search every word in the document is parsed (read) and matched with the search words.
Results are displayed based on the matches found.
Reading every word of the article matching it with the search word over thousands or even lakhs of documents is very
difficult task. Also by default, PHP is configured to run maximum 30 seconds.

Prerequisites:

To understand this article, you should have a fair knowledge of PHP. To run examples given in your machine,
you need APACHE, PHP,
and MYSQL software installed and configured. I used PHP Version 4.3.1 and MYSQL 2.2.3.

Building Database:

The database consists of three tables. viz. Content Table, Keyword Table, Link Table. Content table holds article??s
title, and abstract. Keyword table holds keyword. Keyword field is indexed. Link table holds keyword id, content id.
The SQL Statement for creating these three tables are shown below.

Content Table:


CREATE TABLE content ( 
contid mediumint(9) NOT NULL auto_increment, 
title text,
abstract longtext, 
PRIMARY KEY (contid) ) TYPE=MyISAM; 

1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
|
|
|