Skip to content

Instantly share code, notes, and snippets.

@bds
Created January 8, 2014 03:58
Show Gist options
  • Save bds/8311560 to your computer and use it in GitHub Desktop.
Save bds/8311560 to your computer and use it in GitHub Desktop.
Return 100 primary keys from a Rails Sunspot Solr search
Model.search { paginate :page => 1, :per_page => 100 }.hits.map(&:primary_key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment