Log in

View Full Version : Search Engine



blm126
11-12-2006, 10:15 PM
I'm looking for some general advice on how to best implement a search engine. All data for the site is stored in a SQLite database. I'm not sure how to go about this.

Twey
11-12-2006, 11:05 PM
SELECT * FROM pages WHERE text LIKE '%query%';... is a start.

blm126
11-12-2006, 11:48 PM
LOL, yes I guess that is a start. I'm asking because I can't seem to find very much information. From what I have found it appears the best way is to generate a table full of keywords, then when a user searchs for something count the page with the highest matches. That is easy enough to build, just strip HTML then explode the data, but it seems like it would be ineffecient(it would double the size of the database). If anyone knows of any basic search scripts that I could look at, that would help.

Or if I try and search "on the fly"(maybe using sqlite_create_aggregate (http://us3.php.net/manual/en/function.sqlite-create-aggregate.php) and similar_text (http://us3.php.net/manual/en/function.similar-text.php)), it seems like it should take awhile to get a result.

So let me re-phrase my question, of those two methods(or others that I don't know about) what is the best way to search an sqlite database?