9

If I start typing stackov.. in Chrome I can see something like 'Press Tab to search stackoverflow.com'.

SO is basically recognized as a Search Engine.
Do you have any idea of how to implement the same sort of feature in our WebApp?

I think it should be related with OpenSearch

<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="http://sstatic.net/so/opensearch.xml">

thanks

edit:

I think it should be just a matter of specifing an xml defined in this way (http://sstatic.net/so/opensearch.xml)

    <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"

                       xmlns:moz="http://www.mozilla.org/2006/browser/search/"> 
  <ShortName>Stack Overflow</ShortName> 
  <Description>Search stackoverflow.com for answers to your programming questions</Description> 
  <InputEncoding>UTF-8</InputEncoding> 
  <Image width="16" height="16" type="image/x-icon">http://stackoverflow.com/favicon.ico</Image> 
  <Url type="text/html" method="get" template="http://stackoverflow.com/search?q={searchTerms}"></Url> 
</OpenSearchDescription>

and this is the URL that will be used.

http://stackoverflow.com/search?q={searchTerms}

searchTerms will be populated with the string you typed-in in chrome

mickthompson
  • 5,442
  • 11
  • 47
  • 59
  • 1
    As I read it, it doesn't say "search *with* stackoverflow", it says search the domain stackoverflow.com (using whatever search engine Chrome uses), as in "site:stackoverflow.com search terms". – ЯegDwight Mar 05 '10 at 13:52
  • I preferred this answer here about "How to let Google Chrome detect a site search engine?": https://stackoverflow.com/a/14082569/470749 – Ryan Jun 05 '19 at 14:57

1 Answers1

4

Yes, you're on the right track there. It's OpenSearch you're looking for. They have some how-to guides and tutorials on how to implement this on your own website.

Tom van Enckevort
  • 4,170
  • 1
  • 25
  • 40