404 Search Function
Posted February 24th, 2003 @ 09:54pm by Erik J. Barzeski
Matt and I were rapping earlier today and he mentioned how much he liked php.net's search function (php.net/searchterm). This just after a discussion about how necessary "Search" is on our blogs.
So, putting 3 and 1 together, I came up with a built-in search function of my own. I no longer have a 404 page: you're instead either redirected to the page (if there's only one result) or you're shown the search results. So now, just type "http://nslog.com/blah" where "blah" is the search term. Go ahead, give it a try!
Posted 24 Feb 2003 at 9:59pm #
hey man, that's sweet ass. i like it a lot. keep up the good work.
zach
Posted 24 Feb 2003 at 10:08pm #
That's a really good idea! Any chance you can release the code that you used for it?
Posted 24 Feb 2003 at 10:17pm #
I will when I'm sure it doesn't suck. 🙂 I took a very much "get it working, then make it fast" approach to this one. I currently iterate through every line of the search results page building an array of links, and then, if there's only one link, do I redirect to it. Otherwise I spit out the search results. Probably not optimal. We'll see. I'll put another entry called "404 Search Function Code" or something when I get it done.
Posted 24 Feb 2003 at 10:53pm #
Awesome, thanks! 🙂
Posted 25 Feb 2003 at 3:48am #
404 Search Function
NSLog();: "Matt and I were rapping earlier today and he mentioned how much he liked php.net's search function ( php.net/searchterm ). This just after a discussion about how necessary "Search" is on our blogs. So, putting 3 and 1 together, I came up wit...
Posted 26 Feb 2003 at 11:15pm #
A few days ago I promised that I'd post my 404 Search Function code. Here it is (below). Let me cover a few things first. Initially, I did a preg_match after having done a file(). The file() function returns an array. That's a bit costly, so I just wra...
Posted 27 Feb 2003 at 12:13am #
404 Search
Erik J. Barzeski has released his 404 search function code. I have in turn, integrated it into my site. The way the code works is that if you decide that you want to visit http://www.toomuchsexy.org/FOO, and that does not exist, you will either be redi...
Posted 15 Apr 2003 at 10:53pm #
404 Search Page...
Erik created a wonderful 404 search function. It requires only PHP. This explains what it does. I think this one
Posted 31 Jul 2003 at 10:27am #
Erik,
Would you be willing to release the code for the search function. I would be interested in trying it out.
Tameika
Posted 14 Nov 2005 at 9:06am #
I last wrote about the 404 Search in February 2003 (both here and here. Since that time, I've been using the 404 search code quite heavily on every site with MovableType (or any other blogging package). It's undergone some improvements,...