LGF Database Conversion Hijinx 5

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

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? Account Settings 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

► LGF Hits

► Resources

► Never Forget

► Statistics

► 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.

But drill baby drill HAS substance until they can make a car and a house that can run on wind and solar AND make that car and house affordable!

TwitterFacebook
LGF Pages
Recent Pages

Channeling Confucius
6 Pop Culture Mysteries That Were Solved by Fans
43 seconds ago
Views: 1 • Comments: 0
Tweets: 0 • Rating: 0

marjoriemoon
Fareed Zakaria to Romney, 'You need to worry about the very poor.'
2 minutes ago
Views: 3 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
Trial opens 2 years after feds break up Christian militia
2 hours, 23 minutes ago
Views: 80 • Comments: 0
Tweets: 0 • Rating: 0

Randall Gross
Obama's budget headed to Congress
2 hours, 37 minutes ago
Views: 99 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Dreyfus and the Birth of Intellectual Protest
5 hours, 26 minutes ago
Views: 84 • Comments: 0
Tweets: 0 • Rating: 1

researchok
The Man Who Wouldn't Die: New York's Most Fantastic Murder
5 hours, 29 minutes ago
Views: 112 • Comments: 0
Tweets: 0 • Rating: 3

researchok
Mitt's Spin
5 hours, 31 minutes ago
Views: 78 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Strategy
5 hours, 32 minutes ago
Views: 63 • Comments: 0
Tweets: 0 • Rating: 0

researchok
Gender Wage Gap Skewed by Survey Flaws - Miller-McCune
5 hours, 33 minutes ago
Views: 68 • Comments: 0
Tweets: 0 • Rating: 1

researchok
Why Obama Would Be Glad if the Culture War Is a Major Election Issue
5 hours, 33 minutes ago
Views: 89 • Comments: 0
Tweets: 0 • Rating: 1

 Frank says:

Of course you realize you won't be able to hear the organ once we turn the guitars on. -- Introduction to "Louie, Louie" on "Uncle Meat"