Scott Hanselman

On the importance of OpenSearch

April 3, '15 Comments [31] Posted in Open Source
Sponsored By

I'm a big fan of Open Search, the idea, the format, and the user experience it can enable. You start typing a domain you've hit before that you want to search within. When it starts autocompleting, you hit tab, and then type your search.

So, "stacko - TAB - json - ENTER" has me searching StackOverflow for json results. I don't have to google/bing and then add "site:stackoverflow.com" to my query. I don't have to hit the home page then look around for a search box. The site just includes a meta tag and an opensearch.xml file and poof, the site has taught my browser how to search. Once you've tried this, you'll find it hard to browse/search without. You'll prefer sites that include it and be frustrated with sites that don't. (More on that later.)

IMPORTANT UPDATE/NOTE: A buddy of mine points this out, and he's right. That said, I want to say that I like BOTH of them, and I'm very much enamored with the Tab Search feature.

"Just to be clear, these things are not the same thing.

  • OpenSearch is a format for specifying how to search a site. 
  • Tab Search is a particular UX for allowing you to do a search on a non-default search provider. It happens to use OpenSearch to learn how to search different search providers."
  • I setup OpenSearch at Hanselman.com back in 2009!

    Chrome has a great implementation of Open Search.

    Type, Tab, Type, Enter

    I just added a one line META tag and a static XML file. Boom.

    Your static XML file describes what the resulting URL should look like. Here's a small example.


    Hanselman Search
    Search Scott Hanselman's Blog

    http://www.hanselman.com/blog/favicon.ico
    UTF-8
    http://www.hanselman.com/

    This is such a clean and obvious user story. It makes your web browsing experience better.

    User wants to easily search within a site they visit often. Every browser and OS should support OpenSearch.

    Amazon used to support it but in the last year or so removed it in a homepage redesign. It's more than a little ironic that it was a9.com and Amazon.com that came up with OpenSearch and actually host the http://opensearch.org websites, but now the Amazon.com home page doesn't support it.

    If you work for Amazon and are reading this blog post, consider this your calling out. Please put OpenSearch back on Amazon.com.

    Dear Reader, take a minute and see if your favorite browser supports OpenSearch. If it does, try it out. If not, ask them for it. Same for your favorite sites. If you run a site, you can easily add OpenSearch in a few minutes.

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by ORCS Web
    Friday, 03 April 2015 21:13:05 UTC
    Woa... I had NO idea this existed.

    Now I curse you for my future frustrations.
    Rick
    Friday, 03 April 2015 21:15:10 UTC
    I typed Amaz <TAB> and my search term and it worked. Using Chrome.
    Rick
    Friday, 03 April 2015 21:19:07 UTC
    This also worked for me. Should be in the form of
    http://www.amazon.com/s?field-keywords={searchTerms}"
    if you do it manually.
    Kevin
    Friday, 03 April 2015 21:20:23 UTC
    OpenSearch is a great feature, I agree. I implemented it too, though not in 2009, admittedly. ;-)

    Even if a website doesn't support OpenSearch, you can still optimize your search experience when using Chrome. Just open the browser settings, click Manage search engines…, and define shortcuts for sites you commonly use. Note that this only works for websites you've visited.

    For example, I've configured w for Wikipedia, y for YouTube, a for Amazon, and many more. You can then type w <query> within Chrome's omnibox to jump straight to the search results page.
    Friday, 03 April 2015 21:26:10 UTC
    I just suggested this for IE: https://wpdev.uservoice.com/forums/257854-internet-explorer-platform/suggestions/7448536-add-open-search-based-tab-to-search-to-the-addre
    Friday, 03 April 2015 21:28:17 UTC
    It seems to have worked for me...
    Friday, 03 April 2015 21:33:52 UTC
    OK, weird, so how are some of you seeing Amazon Open Search in Chrome and I'm not? It's NOT in the META tags in their HTML.
    Scott Hanselman
    Friday, 03 April 2015 22:44:13 UTC
    IE has supported OpenSearch for quite a while, though not through this gesture. You have to add the search and use it explicitly (in IE9+ this appears at the bottom of the address bar drop-down).
    Heath
    Friday, 03 April 2015 22:57:43 UTC
    wow did not know this

    Thanks,

    Paul Elliott
    Paul Elliott
    Friday, 03 April 2015 23:52:54 UTC
    This sounds like a neat idea to add to my clients' sites! Do you know off the top of your head whether adding this extra tag also enables the site-specific search bar in Google search results?
    Saturday, 04 April 2015 04:53:38 UTC
    Is there an equivalent for mobile?
    David
    Saturday, 04 April 2015 10:09:44 UTC
    FWIW, I think the Chrome omnibox uses heuristics in addition to OpenSearch to find search engines. There are numerous search engines that have configured themselves in my omnibox that absolutely don't have any opensearch descriptions. A quick test using a new profile in Chrome it seems that this happens when you have performed a search (or two). Try e.g. on edition.cnn.com (I'm overseas, so YMMV).

    From my experiments with OpenSearch, Chrome does seem to honour the "same-origin" requirement, i.e. that an opensearch.xml needs to refer to a search engine from the same origin. Try e.g. to go to some pristine stackexchange site (one that you don't have in your omnibox yet) but using https — the omnibox won't discover it because the opensearch.xml file explicitly says to use http.
    Erik Mogensen
    Saturday, 04 April 2015 10:10:09 UTC
    WoW . Thanks;)
    Saturday, 04 April 2015 16:47:01 UTC
    I don't get it.

    Where do you type "stacko - TAB - json - ENTER"?
    Don
    Saturday, 04 April 2015 22:48:36 UTC
    Have you heard of yubnub? That works a bit like what you describe, but you Can do much much more...
    Benjol
    Monday, 06 April 2015 14:59:47 UTC
    @Don - I gather this only works in Chrome? You type in the address bar. Scott's "stacko - tab - json - enter" example worked for me in Chrome, but not Firefox (and I gather from other comments that it doesn't work in IE).
    Monday, 06 April 2015 15:10:00 UTC
    @Jon - Thanks. I use FireFox, no wonder I couldn't figure it out. On my PC, it works in Chrome, not in Opera.
    Don
    Monday, 06 April 2015 19:40:46 UTC
    In Firefox we can simulate using a bookmark.

    Location: http://www.hanselman.com/blog/?q=%s
    Keyword: h

    Then in address bar:
    h json [Enter]
    Costel
    Tuesday, 07 April 2015 09:26:53 UTC
    It may not be the same mechanism, but as Costel mentioned, you can use a bookmark to get roughly similar behaviour in Firefox.

    - Navigate to the site you're interested in searching e.g. Stackoverflow.com
    - Right click in the search bar and select "Add a keyword for this search"
    - Define a keyword e.g. "stacko"
    - perform searches by typing "stacko json" in the address bar

    Not quite as elegant as the neat Tab search UX mentioned, but it's been around since at least 2008, and I found it really pleasing the first time I saw it =D
    Chris
    Tuesday, 07 April 2015 12:07:19 UTC
    This is pretty cool. I've added it to the ASP.NET MVC Boilerplate project template, so it now supports Open Search right out of the box!!! I have added comments and links to relevant URL's to help support developers too.

    So far, its had 11,500 downloads in four months and is the third most popular Visual Studio project template. I'm still adding new features every few days and have a long list of things to do yet. Features like this should be in Microsoft's default project template!
    Wednesday, 08 April 2015 10:54:33 UTC
    Wow!! Did not knew this!! Thanks
    Wednesday, 08 April 2015 16:26:55 UTC
    989306121623
    Thursday, 09 April 2015 11:20:06 UTC
    Mind blown. The Chrome Experience is beautiful and very UX friendly. IE, not so much. I'm really happy I found this and will be adding it to my sites but unfortunately the majority of my users use some form of IE so this very cool feature is basically lost on them. Someone mentioned that you have to explicitly add it but in Chrome "it just works". Maybe a feature I need to suggest for Spartan.
    Thursday, 09 April 2015 11:31:31 UTC
    Just as a follow-up to my previous comment it seems it was there in IE7 and IE8 but then vanished in IE9 (http://bit.ly/1y7PevK). Another comment from a fellow MVP of mine asks why it's missing in IE10 (http://bit.ly/1NdX79P). Curiously in both cases, asked in the IE community forums where questions should be asked and answered, both times the answer was a redirect to a generic landing page or to Microsoft Connect where you're supposed to log a ticket. The messages (going back to 2012) in the IE threads are just frustration from people asking about it and not getting an answer. Failure by the IE team IMHO.
    Monday, 13 April 2015 14:43:12 UTC
    Project Spartan is turning away from openness, but there's still time to fix it.

    http://textslashplain.com/2015/04/13/opensearch/

    Support freedom #SupportOpenSearch
    Friday, 24 April 2015 18:22:55 UTC
    This is a great feature, but I tried adding it to our https-only site and found that it isn't picked up by Chrome. It seems that Chrome will only autodiscover opensearch if an http (non-SSL) request is made to the site at least once.
    Todd Saylor
    Tuesday, 19 May 2015 13:46:36 UTC
    This is great and I cant believe I didnt know about it until now. As soon as I read this I went and added it to my site, great little feature for almost no work. - Thanks.
    Tuesday, 26 May 2015 05:42:41 UTC
    Hm, seems to be a little hit and miss if the implementation in Chrome works or not. I cannot get it to work on your site, Scott, there I only tab through the list of last visited pages on your website. When I enter "hanselman" in the omnibox and press tab, I only get the last page I visited (for example http://www.hanselman.com/blog/). If I start writing a search query, it's just filled in at the end of the url, for example http://www.hanselman.com/blog/my_search_query.

    It works on StackOverflow, though.
    Tuesday, 26 May 2015 06:34:44 UTC
    There is a typo in the opensearch.xml example:
    <img width="16" height="16">http://www.hanselman.com/blog/favicon.ico

    should be
    <image width="16" height="16">http://www.hanselman.com/blog/favicon.ico</image>
    Tuesday, 26 May 2015 08:14:03 UTC
    I tested a bit more. It seems to work in Chrome only _after_ you have searched "the old fashioned way" at least once.

    So for example here on hanselman.com, I couldn't type "hansel TAB my query ENTER" when I had just visited the blog, but after I had used the search box at the top of the page once, it worked.
    Comments are closed.

    Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.