Sinatra extension for use with IndexTank
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/sinatra
spec
.gitignore
.rspec
Gemfile
README.textile
Rakefile
sinatra-indextank.gemspec

README.textile

sinatra-indextank

Extends Sinatra with an extension method for dealing with IndexTank.

Installation

Install it with gem:

$ gem install sinatra-indextank

Now we can use it an example application.

require 'sinatra'
require 'sinatra/indextank'

# Obtain an IndexTank client using your private api url
# Or, specify the INDEXTANK_API_URL as an environment variable
set :indextank, 'http://_your_private_api_url@api.indextank.com'

# At this point, you can access the IndexTank::Client object using the 'indextank' helper:

get '/search' do
  @results = indextank.indexes('idx').search(params[:q])
end