Press "Guide" to search the site?

Asked

Viewed 1,013 times

7

Recently I went to the site of Sopt by Google Chrome and I came across an interesting feature that is the "Tab to Search" (Omnibox).

In short, by typing the address of a website and pressing the button Tab you perform the search directly on a specific website without the need to change the search engine and other solutions.

The image below illustrates better what I am saying:

inserir a descrição da imagem aqui

Following the example of Sopt, by pressing Tab and perform a search, the browser redirects me to the site search page, in this case /search?q=termo%20pesquisado.

As I said before, I have three questions that are interconnected, which are:

  • What feature is this?
  • How to add to my website?
  • Only Google Chrome has this support?
  • 1

    http://stackoverflow.com/questions/7630144/how-to-add-google-chrome-omnibox-search-support-for-your-site

  • 1

    @durtto Thanks for the link. I’ve read it and others. I just wanted to bring it here because I couldn’t find anything like it here. xD

  • How long has it been? I saw it for the first time today!!! What madness!

1 answer

3


Probably refers to the application/opensearchdescription+xml, is an XML format that adds custom search to your site, should look something like this:

<link rel="search" type="application/opensearchdescription+xml" title="Titulo" href="busca.xml">

And the search.xml:

<?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>Nome do buscador</ShortName>
    <Description>Descrição</Description>
    <Tags>asp.net programar core</Tags>
    <Contact>email de contato</Contact>
    <InputEncoding>UTF-8</InputEncoding> <!-- altere para o seu charset padrão usado na página nos inputs -->
    <OutputEncoding>UTF-8</OutputEncoding> <!-- altere para o seu charset padrão usado na página na saida -->
    <Image width="16" height="16" type="image/x-icon">{endereço do icone}</Image>

    <Url type="text/html" method="get" template="http://www.meusite.com.br/busca?q={searchTerms}" />
    <Url type="application/opensearchdescription+xml"
        rel="self"
        template="http://www.meusite.com.br/busca.xml" />
    <Language>pt-BR</Language> <!-- idioma da página -->
    <AdultContent>false</AdultContent>
    <Attribution>Atribuição do proprietário/empresa</Attribution>
</OpenSearchDescription>

Most of the tags are optional, I will search a little more and add the detail on each one, have more possible settings but some time ago I do not work with this.

Note that each page within the same site can have its own search XML.

To adjust the sending of the request adjust the method, being POST or GET with the attribute method="" and the template= containing the url, the {searchTerms} will be obtained by what the user has edited, this should all be done in the tag Url:

<Url type="text/html" method="get" template="http://www.meusite.com.br/busca?q={searchTerms}"></Url>

List of predefined suggestions:

You can use a json URL tag with predefined suggestions:

 <Url type="application/x-suggestions+json" template="URL do json" />

Example:

[
   "sea",
   [
      "sears",
      "search engines",
      "search engine",
      "search",
      "sears.com",
      "seattle times"
   ],
   [
      "7,390,000 results",
      "17,900,000 results",
      "25,700,000 results",
      "1,220,000,000 results",
      "1 result",
      "17,600,000 results"
   ],
   [
      "http://meusite.com.br?q=sears",
      "http://meusite.com.br?q=search+engines",
      "http://meusite.com.br?q=search+engine",
      "http://meusite.com.br?q=search",
      "http://meusite.com.br?q=sears.com",
      "http://meusite.com.br?q=seattle+times"
   ]
]

The format of the array:

  • In the first item of the array we have the word that will fetch the suggestions
  • In the second we have 6 suggestions of Palavas
  • On the third we have the result for each suggestion
  • In the room we have the urls that can be modified for each word, being able to facilitate the use with friendly urls.

Support:

Browsers like Google Chrome and Firefox support well the opensearchdescription, but other browsers do not have as much or no support for this, anyway let the <link type="search" ...> will not affect them negatively.

  • But in Firefox there is some option to search directly on the site without having to toggle the "Search Engine"?

  • 2

    @Randrade Firefox tried to implement its own version of Omibox, but removed (I remember having used), today they work similar, but not in all aspects, in the case of Opensearch only clicano the "more" sign in the search engine and adding. It is something that belongs to the browser, only Chrome and some others based on Chrome make all interaction with something similar to Omibox, is a feature of the browser (I admit that I find it much more practical, Google understands UX :D)

  • 2

    Google being Google. kkk

Browser other questions tagged

You are not signed in. Login or sign up in order to post.