Knowledge Base gets OpenSearch
If you were looking really hard while browsing our knowledge base recently, you might have noticed your Firefox search window glowing. You are using Firefox aren’t you? (get it here) Ok ok, if you’re stuck with IE7 you might have seen it as well. Anyway, the glowing search box is letting you know that there’s a new search engine available on this page to add to your browser’s drop-down list. This means you can search the PaperCut knowledge base quickly from your browser’s toolbar (without having to browse to the search page first).
The syntax is really quite simple, the bulk of it being contained in an XML file – an “OpenSearch description document”. You can view the OSDD (I just made that up because I didn’t want to type it again) for our knowledge base here.
Most of it is just fluff that may or may not be ever needed/used. The important bit is the <Url /> tag. You’ll notice ours is quite long – this is mainly to do with customising the search results (excluding pages that aren’t relevant to people looking for answers in the knowledge base). A much simpler form of this tag might look like so:
Then the following line in the <head> section of a page will make it available for consumption:
<link rel="search" type="application/opensearchdescription+xml" href="https://www.papercut.com/papercut.osd.xml" title="PaperCut" />
That’s it. The glowing effect in the browser and everything needed to add it to the list of engines is all done for you. Search plugins to the masses!