database search engine

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
countdruncula
Forum Newbie
Posts: 1
Joined: Thu Jul 31, 2003 7:10 am
Location: London, England

database search engine

Post by countdruncula »

I am currently working on a php driven website for a client. My php experience is fairly limited. The db is a pretty simple affair - basically, a table of my client's clients - names, some blurb about them, and they would like to attach a MS Word CV to each client. My questions are twofold:

1. They would like a search textfield and button, which would go through the blurb field in the client table an find any relevant matches. Simple enough - however, how would i go about excluding words that may be common to all the records - "the", "a", and so on.
Also, how would I go about splitting up any search terms entered, so if the term entered is "creative director", the search results would return both records with that exact term, but also records with either word? My script at the moment is as follows, but woefully simplistic:

Code: Select all

$strSQL = "SELECT firstname, lastname, blurb FROM emps WHERE blurb LIKE '%" . $searchTerm . "%'";
Am I trying to reinvent the wheel here - is there a standard way of doing this that I have overlooked.

2. The other problem that I have I am unsure how to begin tackling. My client insists that all their clients must have their CVs in MS Word format. To ensure browser compatibility and also because, frankly, MS word docs look so sh*t, I would like to use php to parse the text in the documents and them place them on an html page tagged with my own style sheet.

Is there a way I can store these docs in the db (using a BLOB field?), and then parse them - giving that they are all look completely different in design and style?

Thanks for your help, even a couple of relevant links would be much appreciated.
Regards
Craig
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

Take a look at this:
As of Version 3.23.23, MySQL has support for full-text indexing and searching.
http://www.mysql.com/doc/en/Fulltext_Search.html
Post Reply