Home Contact Search Syndication   Login
  191 Posts • 2276 Comments • 158 Trackbacks   

 Recent Posts


 Search


  

 Archives

 Post Categories

 Ryan Farley Sites

After my last post, I decided to do what I outlined to throw together a quick search page for my blog. Give it a try:

Not too bad for a few minutes of playing around. Basically I did use Scott Mitchell's RssFeed server control. I take the search value and set it as the source for the control like this:

string search = string.Format("http://beta.search.msn.com/results.aspx?q=site%3Aryanfarley.com+{0}&format=rss", 
                              HttpUtility.HtmlEncode(SearchText.Text));
RssFeed1.DataSource = search;
RssFeed1.DataBind();

That's it. The rest was just adding some formatting via the RssFeed control's properties. Search away.

Posted on Wednesday, January 12, 2005 1:15 PM

Feedback

# re: My New Blog Search - Eric W. Bachtal
Sweet. Simple. Very nice.

1/12/2005 2:25 PM

# re: My New Blog Search - Jeremy
Very nice indeed but I found a bug/issue/slight nitpick.

Try searching for Unicode. You have no search results so it shows nothing. I almost thought it wasn't working until I figured out that I was searching for the wrong material.

Simple fix:
if (search == "")
{
search = "No results found"
}

Well that's sort of it. You would have to convert the results to HTML to render properly. Adding bold or italicizing the error message would probably be a nice bonus too.

1/12/2005 4:01 PM

# Ryan Farley - .Text Search Zen Master - RoudyBob.NET


1/12/2005 7:22 PM

# Ryan Farley - .Text Search Zen Master - RoudyBob.NET


1/12/2005 7:42 PM

# re: My New Blog Search - Ryan Farley
Jeremy,

Thanks for the feedback. Great idea. There's actually other bugs I need to work out still - I just didn't have time to address them before and just wanted to throw the base part of it together.

After I get the rest of the bugs worked out and add your suggestion I'll see if there is some generic way to package it all up for use with other .Text blogs.

Thanks,
-Ryan

1/12/2005 8:42 PM

# re: My New Blog Search - Ryan Farley
OK Jeremy. I changed things a bit. Scott's RssFeed control can bind to a XPathDocument instead of a URI. I took that approach so I could load the XML and get details from it pre-bind.

Much better now.

1/12/2005 9:28 PM

# Another Great .Text Search... - Gary's Blog


1/13/2005 4:04 AM

# Another Great .Text Search... - Gary's Blog


1/13/2005 6:10 AM

# re: My New Blog Search - Kent Chen
Just noticed that the search results only return the content that has been index into MSN, any contents that are not indexed won't be able to show up. Another words, it won't give you the full feature of the search result.

Please correct me if I am wrong.

I have been looking for the search feature for a while since I use .text as my blog platform. Besides upgrading to the new version of the .text (0.96) which gave me the trouble to install, this one is the best one so far. I will deploy it in anyway.

1/13/2005 9:32 AM

# re: My New Blog Search - Kent Chen
additional to my last comment, it seems that only the content on the first page will not be searchable.

1/13/2005 10:05 AM

# re: My New Blog Search - Ryan Farley
Thanks for the comments Kent. Yes, the search will only return items that have been previously indexed by MSN search. That's not too bad of a trade off considering the solution only took 20 minutes or so to put together and I didn't have to write any of the actual searching or indexing code myself. I have been toying with the idea of adding a custom search solution where I could use the MetaBlogAPI or going direct to SQL server, but haven't thought it through enough to come up with a design I am happy with (and have the time for). At least for now this is "something".

I don't have a problem finding posts in the search that appear on the main page. For example, I can search for IHtmlDocument, which I posted about only a few posts ago, and it comes back fine. Part of the problem you were seeing is that I was toying around with some ideas like adding the word "archive" to every search so it would only bring back hits with the word archive in the URL in an attempt to weed out some of the category & other "listing" pages and just get to the actual posts. I've removed that now as it was not giving the best results. Seems better now.

Thanks,
-Ryan

1/13/2005 11:15 AM

# re: My New Blog Search - Kent Chen
How come nothing happens when I click the search button? Should I put the search.aspx page on the seperate folder?

By the way, you are amazing...20 minutes only took me figure out how the user control works. :)

1/13/2005 10:21 PM

# re: My New Blog Search - Jeremy
Much more professional looking by including the number of responses and the search text when nothing is found.

A search of .Text blogs would be a good idea but if your site is indexed on MSN then there's honestly no need as this would serve the purpose quite well. It may lag behind as MSN indexes the pages but it's a small price to pay for search you can use NOW.

I'm definately feeling the Zen.

1/14/2005 3:40 PM

# re: My New Blog Search - Dave Burke
Ryan, This is slick and you've done an excellent job describing its implementation. I went with 0.96's Lucene and ScheduledEvents components and it works really well, but this is sweet, too!

btw, here's my 0.96 lucene implementation. Not quite as streamlined as your approach.

http://dbvt.com/blog/archive/2005/01/24/786.aspx

You've got a heckuva blog, Virtual Public Guy! Subscribed!


1/29/2005 6:51 PM

# re: My New Blog Search - Ryan Farley
Thanks Dave! Nery nice. I really like your customized blog. That's the biggest advantage of hosting your own blog. Any tweaks or changes you can just make yourself.

-Ryan

2/15/2005 9:14 AM

# New Skin - Bryant Likes's Blog


3/17/2005 2:49 PM

# New Skin - Bryant Likes's Blog


3/17/2005 4:58 PM

# Adding search to your ASP.Net site the easy way - Mischa Kroon
This is a great way to add search to a website, and it's so simple that you will probably love it. ...

9/6/2005 4:25 AM

Post Feedback

Title:
Name:
Url:
Comments: 
 Enter the word you see: