LGF Database Conversion Hijinx 5

Charles Johnsonfollow me on twitter
Tue Mar 27, 2007 at 1:20 pm PDT • Views: 322

Some more books on my desk:

Most of the Blog Engine is now refactored to use MySQL. (Not on the live server; on the development server.) I saved what I thought would be the hardest part for last: the LGF search feature. But MySQL’s built-in search capabilities are not only much simpler to implement than the existing brute-force “scan every file looking for a match to a string” approach, the MySQL search will be much more powerful, and a lot faster.

For the database nerds, I’ve added FULLTEXT indexing to the entries and comments, so our new search module will be able to give you much more intuitive results, similar to a search engine such as Yahoo or Google. To get even more technical, we’ll have keyword-based “boolean” searches, where you can choose which words to include or exclude from the search.

For example, search for:

Osama bin Laden

…and you’ll find posts that contain any of those three words. A post that has the word “Osama” would show up, even if the other two words weren’t present.

But put a plus symbol in front of each word you want to include:

+Osama +bin +Laden

…and now the search will find posts that contain all three words.

The minus symbol does the opposite; it says, “don’t include this word” in the search.

Results can also be sorted by relevance, and you can even specify the relevance of a search keyword, by using the ‘>’ and ‘~’ operators. There are other boolean operators too, for wildcards and simple pattern matching, but that’s for another post. (If you can’t wait to find out the wonders that lie ahead, here’s the MySQL Reference Manual: Boolean Full-Text Searches.)

And speaking of “faster,” doing a FULLTEXT search through 3.6 million LGF comments for the term “+Osama +bin +Laden” returns 5,157 results.

And it takes 0.0259 seconds. That’s right. 3.6 million comments in two hundredths of a second.

I know, it’s a bit slow. I’m working to optimize it now. (I kid.)

UPDATE at 3/27/07 1:31:33 pm:

Oh, and I should mention, so no one gets the wrong idea — none of this incredible newness is actually live on the site yet. The whole house of cards is in final testing on the development server.

Advertisement

510 comments

^ back to top ^

Name:

Pass:

Register Forgot Your Password? Re-send Confirmation (To log in, cookies must be enabled in your browser!)

Turn off ads by subscribing!
For about 33 cents a day, our subscription option turns off all advertisements at LGF!
Read more...


► LGF Headlines

  • Loading...

► Tweeted Articles

  • Loading...

► Tweeted Pages

  • Loading...

► Top 10 Comments

  • Loading...

► Bottom Comments

  • Loading...

► Recent Comments

  • Loading...

► Tools/Info

► Tag Cloud

► Contact

You must have Javascript enabled to use the contact form.
Your email:

Subject:

Message:


Messages may be published in our weblog, unless you request otherwise.
Tech Note:
Using the Contact Form

More Partners

Compare Electricity Prices in your area. Texas Electricity is deregulated; you have the right to choose Texas Electric Rates from among many Texas Electric Companies.

A tough room.

TwitterFacebook
LGF Pages
Recent Pages

Randall Gross
A Tech Story that's near and dear to my heart
2 minutes ago
Views: 9 • Comments: 0
Tweets: 0 • Rating: 0

Haywood Jabloeme
Mitt Romney Has Huge Lead With Vets, Poll Says
4 minutes ago
Views: 5 • Comments: 0
Tweets: 0 • Rating: 0

MikeySDCA
5 Seemingly Harmless Things That Are Stressing You Out
16 minutes ago
Views: 11 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Lost Classics: An Address Delivered in 2009 to Graduates in Classics at UC Berkeley
6 hours, 57 minutes ago
Views: 90 • Comments: 0
Tweets: 0 • Rating: 0

Mostly sane, most of the time.
So wake up and notice already
10 hours, 9 minutes ago
Views: 73 • Comments: 0
Tweets: 0 • Rating: 0

Daniel Ballard
Late Afternoon Light-Kalanchoe
1 day, 14 hours ago
Views: 190 • Comments: 0
Tweets: 0 • Rating: 5

Eclectic Infidel
City College of San Francisco Budget Update
1 day, 15 hours ago
Views: 211 • Comments: 0
Tweets: 0 • Rating: 1

Aigle
National Geographic Traveler Veers Off Track
2 days, 20 hours ago
Views: 794 • Comments: 16
Tweets: 25 • Rating: -6

MichaelJ
Apple TV Slated to Debut in December?
2 days, 21 hours ago
Views: 298 • Comments: 0
Tweets: 0 • Rating: 1

Ascher
Israeli Who Saved Turk on Everest: You Never Abandon a Friend - Israel News, Ynetnews
2 days, 22 hours ago
Views: 366 • Comments: 1
Tweets: 0 • Rating: 4

 Frank says:

Remember there's a big difference between kneeling down and bending over.