Skip to main content

Posts

Showing posts with the label presentation

(Project) Designing and Building a Simple Search Engine with PHP, MySql

I hope this will encourage you to develop an engine that suits your particular needs, with the exact features you desire. Database Design and Logic We'll use MySQL as a database backend to store our search data. It's possible to shell out to Unix commands such as grep and find, but that would mean running the search engine on the machine hosting the files. As well, it would be more difficult to index pages served from a database. We'll tackle the database first. The database for the search engine consists of three tables: page, word, and occurrence. page holds all indexed web pages, and word holds all of the words found on the indexed pages. The rows in occurrence correlate words to their containing pages. Each row represents one occurrence of one particular word on one particular page. The SQL for creating these tables are shown below. CREATE TABLE page (    page_id int(10) unsigned NOT NULL auto_increment,    page_url varchar(200) NOT NULL default '', ...