Search
Joe Pruitt - A Software Architect's take on Network Security
You are here: DevCentral > Weblogs

posted on Wednesday, July 21, 2010 2:21 PM

I recently received an internal iRule email and one of our folks created a search provider for FireFox to search DevCentral.  Lori quickly responded and asked if we could get this posted to DevCentral.  Why not if it will help the community so I took a look.  Then it occurred to me that a while back I created a search provider definition based on the OpenSearch specification.  For some reason, on our last site refresh, the links in our website were removed so the browser didn’t natively pick them up.   I fixed that so now you can add DevCentral as a native search target in your browser of choice.

Here’s a little background on OpenSearch, how I implemented it on DevCentral, and how to set it up in your browser.

OpenSearch

OpenSearch is a format that can be used to describe a search engine so that it can be accessed and used by search client applications such as web browsers.  It’s basically just an XML file that you put on your webserver and by adding a hidden tag in your application pages, a browser is able to automatically access the search pages on your site.

Creating the Search Engine

The first step is to create the search engine definition file.  In this case, I called that file OpenSearch.xml.  The format for that file is defined here.  For DevCentral, you can view the definition directly at OpenSearch.xml.

   1: <OpenSearchDescription>
   2:   <ShortName>DevCentral Search</ShortName>
   3:   <Description>Search F5's DevCentral Developer Community</Description>
   4:   <Url type="text/html" method="get" 
   5:     template="http://devcentral.f5.com/Default.aspx?..q={searchTerms}"/>
   6:   <Image width="16" height="16">http://devcentral.f5.com/favicon.ico</Image>
   7:   <InputEncoding>UTF-8</InputEncoding>
   8:   <SearchForm>http://devcentral.f5.com/</SearchForm>
   9: </OpenSearchDescription>

It’s pretty self explanatory.  The only thing you need to make sure you include in is the {searchTerm} template value into your search url.

Exposing it to Browsers

Once you have the definition setup, you need to broadcast it to the browsers accessing your site.  This can be done with a hidden link tag in the header of your HTML pages.  By adding a “link” element of type “application/opensearchdescription+xml”, the browser will look at the “href” attribute for the location of the search provider.

   1: <head>
   2:   ..
   3:   <link rel="search" type="application/opensearchdescription+xml" 
   4:     title="DevCentral Search" href="http://devcentral.f5.com/opensearch.xml" />
   5: </head>

That’s it.  Now site search is ready to be configured in the browsers.  For each of the following steps, click on the DevCentral homepage before starting.

Installing in FireFox

OpenSearchFireFox1

Click on the drop down on the left side of the search control in the browsers address bar.  You will see a Add “DevCentral Search” menu item. 

OpenSearchFireFox2 Select this item and you will now have “DevCentral Search” as your default search provider.  This can be changed back by selecting another drop down from the menu.

Now you should see the F5 logo in your search control and by typing a search term in it, it will take you to the DevCentral search results for that query. 

At this point the search provider is available to you on any website you visit, not just when you are visiting DevCentral.

Installing in Internet Explorer

OpenSearchIE1a

Installation for Internet Explorer is almost as easy as FireFox.  The search control dropdown on the top right of the browser will have a “Add Search Providers” menu item. 

OpenSearchIE2OpenSearchIE3 Select that and you will then see “DevCentral Search” as an option.  By selecting that menu item, you will be presented with a “Add Search Provider” dialog box.  Click the “Add” button.

At this point, you now have Internet Explorer configured to browse DevCentral anytime you please.  If you didn’t make it your default search provider in the Add dialog box, you’ll have to select it from the menu.

Now by typing a search term, you will be taking to the DevCentral search just like you were with the previous Firefox installation.

Installing in Google Chrome

OpenSearchChrome1

Google Chrome behaves a bit different as it doesn’t have a dedicated search control, but relies on the address box to do both navigation and search.  The search provider settings can be found by right clicking in the address control and you will find an “Edit search engines…” menu item. 

OpenSearchChrome2OpenSearchChrome3 By selecting that menu item, you will be presented with a dialog box containing the currently configured default engines, and others that Google thinks you might like. 

Look for “DevCentral Search” at the bottom of the list.  Highlight it and click the “Make Default” button on the right side of the dialog box.

Now, just enter your search term in the address control and Chrome will take you to the DevCentral search results page.

Enjoy!

-Joe



Feedback

8/9/2010 9:13 AM
Gravatar
Excellent! Thank you
shirley

Let Me Know What You Think


Please use the form below if you have any comments, questions, or suggestions.

Title:
 
Name:
 
Email: (so we can show your gravatar)
Website:
Comment: Allowed tags: blockquote, a, strong, em, p, u, strike, super, sub, code
 
Please add 8 and 4 and type the answer here:

Blog Stats

Posts:379
Comments:1067
Stories:1
Trackbacks:301
  

Article Categories

  iRules
  

Image Galleries

  

Joe's bookshelf: read

The Lost Gate
4 of 5 stars
This one started slow but I got really got into it about 1/3 of the way through. If you are an Ender's Game fan, you'll probably like this one as well.

goodreads.com


82,243 Members in 102 Countries and Growing!

Join DevCentral Today!

About DevCentral

DevCentral has been a successful, thriving community for many years. We have always strived to bring you the best technical documentation, discussion forums, blogs, media and much more that we can.

So dive in, get familiar with DevCentral. We hope you like it, we hope it makes your job easier, and lets you get that much more power out of the community. To learn more, make sure to check out the Getting Started section. And if you have any problems, or think something could be easier to use, drop us a line to let us know.

Got It !

We've received your comment and transmitted it directly to DevCentral HQ.

Thanks for taking time to let us know what's on your mind. At DevCentral | Community Matters!

Get In Touch With Us

Have questions, suggestions or just want to get something off your chest?

Use our handy form below to Direct Connect with DevCentral Mission Control.

Send Us Feedback       or