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.
http://stackoverflow.com/questions/7630144/how-to-add-google-chrome-omnibox-search-support-for-your-site
– durtto
@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
– Randrade
How long has it been? I saw it for the first time today!!! What madness!
– LCarvalho