Scott Hanselman

On the importance of OpenSearch

April 04, 2015 Comment on this post [29] 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
    Hosting By
    Hosted in an Azure App Service
    April 04, 2015 1:13
    Woa... I had NO idea this existed.

    Now I curse you for my future frustrations.
    April 04, 2015 1:15
    I typed Amaz <TAB> and my search term and it worked. Using Chrome.
    April 04, 2015 1:19
    This also worked for me. Should be in the form of
    http://www.amazon.com/s?field-keywords={searchTerms}"
    if you do it manually.
    April 04, 2015 1:20
    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.
    April 04, 2015 1:26
    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
    April 04, 2015 1:28
    It seems to have worked for me...
    April 04, 2015 1:33
    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.
    April 04, 2015 2:44
    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).
    April 04, 2015 2:57
    wow did not know this

    Thanks,

    Paul Elliott
    April 04, 2015 3:52
    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?
    April 04, 2015 8:53
    Is there an equivalent for mobile?
    April 04, 2015 14:09
    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.
    April 04, 2015 20:47
    I don't get it.

    Where do you type "stacko - TAB - json - ENTER"?
    Don
    April 05, 2015 2:48
    Have you heard of yubnub? That works a bit like what you describe, but you Can do much much more...
    April 06, 2015 18:59
    @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).
    April 06, 2015 19:10
    @Jon - Thanks. I use FireFox, no wonder I couldn't figure it out. On my PC, it works in Chrome, not in Opera.
    Don
    April 06, 2015 23:40
    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]
    April 07, 2015 13:26
    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
    April 07, 2015 16:07
    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!
    April 08, 2015 14:54
    Wow!! Did not knew this!! Thanks
    April 09, 2015 15:20
    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.
    April 09, 2015 15:31
    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.
    April 13, 2015 18:43
    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
    April 24, 2015 22:22
    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.
    May 19, 2015 17:46
    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.
    May 26, 2015 9:42
    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.
    May 26, 2015 10:34
    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>
    May 26, 2015 12:14
    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.