Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby: Wrapper for acts_as_solr results that behaves/feels like will_paginate collection
Ruby
Tag: v0.1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
README.markdown
Rakefile
VERSION
init.rb
solr_collection.gemspec

README.markdown

SolrCollection is a wrapper for solr results sets then behaves/feels like will_paginate collection

  • no need to seperate results from facets / spellcheck information
  • all pages can use the same pagination helpers
  • simple to mock an empty result when solr is down or throws errors

Usage

  • As Rails plugin script/plugin install git://github.com/grosser/solr_collection.git
  • As gem sudo gem install grosser-solr_collection --source http://gems.github.com

Example: options = {:limit=>10, :offset=>100, :facets=>{....}, .... } results = MyModel.find_by_solr("abc", options) rescue [] results = SolrCollection.new(results, options)

do_something if results.facets
something_else if results.total_entries > results.size #more pages ?
will_paginate(results)

Author

Michael Grosser
grosser.michael@gmail.com
Hereby placed under public domain, do what you want, just do not hold me accountable...

Something went wrong with that request. Please try again.