Searching my blog


A couple of people have contacted me and recommended adding search functionality to my blog. I’m flattered that they feel there is something search-worthy here and am also grateful to people that take the time to help me improve my blog.

As you know, I am not technical. I tell people that so much that I thought I would get a tattoo that says I am not technical. But then I realized that, for everyone to see it, I would have to put it on my forehead. Then I thought about how much this would upset my mother, so I decided against it. Anyhoo, I just don’t have the technical skills to do anything that involves coding. But if I get a good search string, I suppose I can provide links to search engines with partially populated fields that will search just my blog. I went back and looked through all my blog posts, especially my earlier ones, and there does seem to be a lot of “job search reference” stuff there.

So I’m going to give it a shot. Hopefully, I’ll have this up later this week. Thanks for the recommendations!

Comments (21)

  1. Rob Chartier says:

    An easy way is to just use google and search for:

    <terms> site:weblogs.asp.net

    for example:

    career tips site:weblogs.asp.net

  2. Heather says:

    Hi Rob-unfortunately that searches all blogs on asp.net. But might not be a bad isea to have the functionality anyway, in addition to being able to search on just my blog. The MSDN page has a search feature, I believe that hits all the asp.net blogs too.

    Sahil-that looks great. I want to do that but it looks kinda technical. I’m going to give it a try and will let you know if I have problems ; ) Thanks

  3. Heather says:

    Sahil-I just looked at that…dude…I am so not technical! I can’t do that. Anyway. I would want to do MSN search. I could do both MSN and Google but I want to do MSN.

    I think I am back to the idea of linking to a populated search page. ; )

  4. gretchen says:

    I was going to suggest the blog portal: http://www.microsoft.com/communities/blogs/PortalHome.mspx. but it looks like our category of "careers" has been taken over by other blogs. I’ll request a "Microsoft Recruiting" category, and that way people could keyword search just our blogs. that might work. not perfect but it’s better.

  5. Drew says:

    <search_terms> HeatherLeigh site:weblogs.asp.net

    All the hits will either be your blog or someone referring to it. Or people who casually use the term "HeatherLeigh" in their completely unrelated blogs.

  6. Heather says:

    OK, think we’ve got this all figured out thanks to David Cumps…who gave me specific instructions and code to paste (just trying to tweak it so it searches using MSN Search!). You gotta love someone who knows how to spell it out for us non-technical folks. I can install a garbage disposal or a hardwood floor but I can’t put a search button on my blog. Go figure!

    By the way, here’s the link to the instructions: http://weblogs.asp.net/cumpsd/archive/2005/01/11/350909.aspx

    Thanks David!!!

  7. Ilya says:

    Heather,

    You may find it better to replace your current Google search terms with

    <search> site:blogs.msdn.com inurl:heatherleigh

  8. Andy says:

    your enter event isn’t working because you have a syntax error in it. Put ‘+inurl%3Aheatherleigh+%3Aweblogs.asp.net’ instead of ‘+inurl%3heatherleigh+%3Aweblogs.asp.net’ and that should fix it. Hopefully the formatting on that doesn’t get stripped out so you can see what I am trying to show

  9. Heather says:

    Ilya-why is this better? I’m hesitant to make changes without knowing why I am doing them ; ) Not doubting your expertise…just want to make sure I know what I am doing.

    Andy-you totally lost me…I’m…not…technical… (jeez, this is getting humiliating!); ) It was working when I tried it. Do you want to look at the code and see what you think? I know you are busy with the ‘ladies"…but I can send it to you ; )

  10. Ilya says:

    Adding "site:" in front of "weblogs.asp.net" (or "blogs.msdn.com") would narrow down the search to this particular site as it intended to be for a local search.

    Blogs.msdn.com has better coverage rather than weblogs.asp.net and demonstrates better search relevance as far as I can see (tried both 🙂

  11. Heather says:

    Ah…thanks Ilya. That makes sense

  12. Andy says:

    copy past this over your old function of the same name in your source:

    function blogSearch(event, oInput) {

    var keyCode = (event) ? event.keyCode : keyStroke.which;

    if (keyCode == 13) {

    top.location = ‘http://www.google.com/search?q=‘ + oInput.value + ‘+inurl%3Aheatherleigh+site%3ABlogs.msdn.com’;

    return false;

    } return true;

    }

  13. David Cumps says:

    I want to add a reply as well, don’t just copy paste that, but add escape() around oInput.value as well (check my blogpost for updated version and in the comments the reasoning behind this)

    using escape() will allow to search on terms such as c# as well

  14. David Cumps says:

    I’m sorry to reply this fast again :p Apparently you already have escape() around it, but you forgot to put a closing bracket in it, causing a script error on every page I view.

    In the MSN part. After ‘return false’ and before ‘</script>’ put } to fix it 🙂

  15. David Cumps says:

    Other info: I added an important notice to the post about Google terms and rumours about sites being removed from the index, please check it out and decide for yourself 🙂