What must we do to have Google's omnibar show a custom search for our domain:
Like if we go the omnibar and type s-t-a-c-k-o-v-e-r-f-l-o-w-.-c-o-m-[SPACE] the bar will come out, and typing asd in the box for example will take us straight to https://stackoverflow.com/search?q=asd
I've noticed this behavior to be different from that of wikipedia (which takes us to http://en.wikipedia.org/w/index.php?title=Special:Search&search=asd)
The behavior is also different with youtube (which takes us to http://www.youtube.com/results?search_query=asd&page=&utm_source=opensearch)
Well of course not all domains have this behavior, try: g-o-d-a-d-d-y-.-c-o-m-[SPACE] does nothing
How do i instruct the google's omnibar the way to do a search for my domain?
It's this line in the <head>
of each page:
<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml">
And the file it points to:
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Stack Overflow</ShortName>
<Description>Search Stack Overflow: Q&A for professional and enthusiast programmers</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">http://sstatic.net/stackoverflow/img/favicon.ico</Image>
<Url type="text/html" method="get" template="http://stackoverflow.com/search?q={searchTerms}"></Url>
</OpenSearchDescription>
It's called OpenSearch and it's a standard way of specifying how to search your website. See opensearch.org for the specs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With