# \[ANN\] External Search Sources Rails Engine

**URL:** <https://www.ruby-forum.com/t/ann-external-search-sources-rails-engine/172058>\
**Category:** Rails\
**Created:** [July 14, 2009, 2:10am UTC](https://www.ruby-forum.com/t/ann-external-search-sources-rails-engine/172058 "2009-07-14T02:10:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kieran\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a4c791/32.png) [@Kieran\_P](https://www.ruby-forum.com/u/Kieran_P)\
**Post date:** [July 14, 2009, 2:10am UTC](https://www.ruby-forum.com/t/ann-external-search-sources-rails-engine/172058/1 "2009-07-14T02:10:21Z")

</div>

Announcing the release of the External Search Sources Rails Engine  
developed by Katipo Communications ([http://katipo.co.nz](http://katipo.co.nz)) for Kete  
([http://kete.net.nz](http://kete.net.nz)), and funded by Digital New Zealand (http://  
digitalnz.org.nz) and Katipo.

> **[GitHub - kete/external\_search\_sources: Display results from external search...](https://github.com/kete/external_search_sources)**
>
> Display results from external search sources. Contribute to kete/external\_search\_sources development by creating an account on GitHub.

* * *

## What does it do?

The engine allows you to define search sources that are based on web  
services that return RSS feeds of their search results. An example  
search source is the Digital New Zealand content metadata aggregation  
service ([http://search.digitalnz.org.nz/](http://search.digitalnz.org.nz/)).

In your views, you can then call a helper method which is passed a  
search term string that is defined by your code. Your defined search  
sources will then be queried and their results will be presented.

This is an excellent way of displaying partner sites’ related content  
along side your local search results.

There are a number of options that can be used to handle different  
search sources’ boolean syntax and whether results should be cached  
locally.

If the results feed for a search source returns thumbnails, they will  
also be displayed.

* * *

## How does it work?

The engine provides an administrative interface powered by  
ActiveScffold ([http://activescaffold.com/](http://activescaffold.com/)). Administrators can add  
search sources which will be used to get results.

Put simply, a search source is an rss feed from another website. When  
it needs to get results, it adds the search term to the end of a base  
url. The base url needs to end in something similar to ‘&q=’ . That  
resulting url is then fetched and parsed using a modified version of  
Feedzirra ([GitHub - kete/feedzirra: A feed fetching and parsing library that treats the internet like Godzilla treats Japan: it dominates and eats all.](http://github.com/kete/feedzirra)), and output to html,  
which can then be styled using css to suit.

* * *

## Requirements

Because we chose to go with a Rails engine and I18n support in this  
case, Rails 2.3 or higher is required to run the engine.

The administrative interface requires ActiveScaffold be installed and  
working as well.

Finally, the modified version of Feedzirra is needed (http://  
[GitHub - kete/feedzirra: A feed fetching and parsing library that treats the internet like Godzilla treats Japan: it dominates and eats all.](http://github.com/kete/feedzirra)). We have found cases where certain feed  
elements weren’t being detected, so we have added these to our own  
version of the gem and sent pull requests to the maintainers of the  
original gem.

* * *

## Assumptions

The engine has some assumptions for authorization that can be easily  
reconfigured to suit your application.

It assumes you are using the authorization plugin ([http://github.com/](http://github.com/)  
DocSavage/rails-authorization-plugin) and acts as authenticated  
([http://svn.techno-weenie.net/projects/plugins/acts\_as\_authenticated](http://svn.techno-weenie.net/projects/plugins/acts_as_authenticated)).

See the README.rdoc for more information.

* * *

## So how do I install this?

Head on over to it’s Github repository and checkout the README.rdoc  
file.

> **[GitHub - kete/external\_search\_sources: Display results from external search...](https://github.com/kete/external_search_sources)**
>
> Display results from external search sources. Contribute to kete/external\_search\_sources development by creating an account on GitHub.

It has all the steps you need to get running with it as quickly as  
possible. It also has a heap of documentation about configurable  
settings, translating, styling id/classes, and testing.

* * *

## Credits

This engine was co-designed by Kieran Pilkington (

> **[KieranP - Overview](https://github.com/KieranP)**
>
> KieranP has 7 repositories available. Follow their code on GitHub.

) and Walter McGinnis ( [walter (Walter McGinnis) · GitHub](http://github.com/walter) ).

Kieran did the implementation and testing. Walter provided guidance  
and implementation feedback.
