Searching Engine
Moderator: General Moderators
Searching Engine
I am wondering if someone can explain to me how searching engine works in php. DO I have to put every single information into my database, since I used mysql, so it would be easier for me to make one? I am sure that there should be some smarter and more advance way to do so. Thankyou!!! 
Well, it really depends on what you're searching for exactly and what you're searching on.
The 2 common types of search are:
1) SELECT * FROM foo WHERE something LIKE '%somesearchterm%';
2) Use MySQL's FULLTEXT search
The 2 common types of search are:
1) SELECT * FROM foo WHERE something LIKE '%somesearchterm%';
2) Use MySQL's FULLTEXT search
so the only way to search things is to save every imformation in the database, then use the utility of mysql or other database language to search it, right? I am actually hoping if there are some other way whether than using all database. I don't understand the fact that yahoo and google can search things freely without saving everything in database. I want to know how they work.
-
Yonderknight
- Forum Commoner
- Posts: 31
- Joined: Sun Jun 13, 2004 6:51 pm
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
Last time I checked, Google stored everything in a database.artfhc wrote:so the only way to search things is to save every imformation in the database, then use the utility of mysql or other database language to search it, right? I am actually hoping if there are some other way whether than using all database. I don't understand the fact that yahoo and google can search things freely without saving everything in database. I want to know how they work.
Yes, EVERYTHING. (besides images of course).
Imagine having that kind of space in your PC.
There are algorithms for searching. I don't know them tho.artfhc wrote:so the only way to search things is to save every imformation in the database, then use the utility of mysql or other database language to search it, right? I am actually hoping if there are some other way whether than using all database. I don't understand the fact that yahoo and google can search things freely without saving everything in database. I want to know how they work.
Using db's 'like' command is the slow way. You can use that for a small search space, but need much better stuff for bigger search. Like if google used that, there is no way they could search 5 billion texts in under 0.1 seconds.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
google's database is stored almost entirely in RAM at all times. Their bot is continually crawling their systems to update their cache, as well as spidering the links on the pages. We may see some of how Google works internally, soon.. 