Well,
It´s complex to explain here, but, you may create a simple search engine starting like it:
table sites (
id_site serial,
category char(30),
subcategory char(30),
title char(100),
url char(100),
description text,
wordkeys char(200));
So you may search this table on the fiels title, url, description and wordkeys using sql structures like 'like %word%'.