rubygems/rubygems.org — pull request #783 by hamedahmadi (2014-12-02 23:02:27+00:00)
Title: Swiftype-powered autocomplete and search

This pull request adds autocomplete and search powered by Swiftype.

To get it set up locally:

1. Create an account at Swiftype.com
2. Create an API-based search engine with a document type called "rubygem"
3. Add your API key (located on the Account Settings page) and Engine key (located on the Engine overview page) as environment variables named like so:

```
ENV['SWIFTYPE_API_KEY'] = "your_api_key"
ENV['SWIFTYPE_ENGINE_KEY'] = "your_engine_key"
ENV['SWIFTYPE_ENGINE_SLUG'] = "your_engine_slug"
```

Presumably this is done via the secrets.rb file, but this code is (understababily) not in the repository.

4. Index the gems in your local database: `rake swiftype:index_rubygems`
5. Browse to the home page and try a search.

Once you are happy with this, to go to production, repeat the steps of creating an engine (we recommend having separate engines for each environment/developer) and adding the `SWIFTYPE_API_KEY` and `SWIFTYPE_ENGINE_KEY` to the environment. Upon deploying, you can run the rake task to index all the existing gems and the search will be live.