I just got the regular monthly email from php|architect Magazine informing me that this month's issue is ready to download, and listing all the wonderful things inside. Turns out they went ahead and published the article I wrote for them a couple of months ago.
The article was titled "How To Write Your Own Search Engine", although they've retitled it and updated it a bit. It covers the use of the inverted index technique to write a search tool using MySQL. I've been doing this kind of technique for a few years now, and I've had to explain it to colleagues so many times, it's nice to finally have an article I can give them instead.
I think it came out well, although I may have spotted a small bug introduced when they tweaked the code I wrote... I'm not sure, as I'm pretty tired and hopped up on morphine, amitriptyline and codeine (all prescribed!) to try to loosen me up after a fairly painful ten-hour trip to London and back for my six-month post-operative appointment with my orthopaedic surgeon.
Anyway, I *think* they've missed out a strtolower() call in Listing 3 around line 17 or 18, thus making searches case-sensitive, even though the indexer downcases everything. As a result, I'm not sure the search will actually work unless you always type in lowercase.
Well, not to worry... whoever did the code clearup must've had a fairly tedious job of getting rid of some of my code style idiosyncracies in an effort to make it more "standard", so I don't begrudge them the odd bug or two.
It was a bit of a surprise seeing the article, as I hadn't heard back from them since I'd submitted the original draft a while ago. Other than a few updates to PDO rather than the mysqli based code I submitted, they haven't made many changes, so I guess my draft was okay as it was.
This is my first proper published article for a print magazine, so I'm eager to hear feedback. To read the article, you have to buy the magazine (either print or PDF download). There are some other neat articles in the issue, so it's worth it IMHO.