LGF Database Conversion Hijinx 5

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

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.

The banana peel of creativity.

TwitterFacebook
LGF Pages
Recent Pages

Daniel Ballard
Late Afternoon Light-Kalanchoe
2 hours, 55 minutes ago
Views: 52 • Comments: 0
Tweets: 0 • Rating: 2

MikeySDCA
Colin Powell Endorsed Same-Sex Marriage Once It Was Safe, More Evidence He's Hardly a Great Leader.
2 hours, 58 minutes ago
Views: 48 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Attachment Birthers
3 hours, 8 minutes ago
Views: 55 • Comments: 0
Tweets: 0 • Rating: 0

Eclectic Infidel
City College of San Francisco Budget Update
3 hours, 47 minutes ago
Views: 70 • Comments: 0
Tweets: 0 • Rating: 0

Michael McBacon
Kansas governor signs 'Shariah bill' to ban Islamic law
8 hours, 18 minutes ago
Views: 173 • Comments: 6
Tweets: 0 • Rating: 4

Aigle
National Geographic Traveler Veers Off Track
1 day, 8 hours ago
Views: 403 • Comments: 5
Tweets: 0 • Rating: -4

MichaelJ
Apple TV Slated to Debut in December?
1 day, 9 hours ago
Views: 203 • Comments: 0
Tweets: 0 • Rating: 1

Ascher
Israeli Who Saved Turk on Everest: You Never Abandon a Friend - Israel News, Ynetnews
1 day, 10 hours ago
Views: 271 • Comments: 1
Tweets: 0 • Rating: 3

Haywood Jabloeme
The Harrassment of Patterico & Its Roots in Left-Wing Activism
1 day, 10 hours ago
Views: 486 • Comments: 2
Tweets: 0 • Rating: 4

Curt
Brian Banks: (Video) Falsely accused of rape speaks out
1 day, 13 hours ago
Views: 245 • Comments: 1
Tweets: 0 • Rating: 3

 Frank says:

Outdoors for me is walking from the car to the ticket desk at the airport.