Home > sunspotify

sunspotify

Sunspotify is a project mainly written in RUBY and JAVASCRIPT, based on the MIT license.

Simple admin panel to manage sunspot/solr setup in your rails app

= Sunspotify

== Introduction

This plugin is created to make managing Solr Search using the Sunspot gem easier. The purpose of this plugin is to provide an admin interface for non-technical people and allow for:

  • Selecting which application models/attributes to index through a simple interface
  • Manual reindexing
  • Starting the Solr server through the web admin

== Installation

add the following lines to your Gemfile

# sunspotify dependencies
gem 'sunspot_rails', '>= 1.2.rc3'
gem 'haml'
gem 'will_paginate', '~> 3.0.pre2'
gem 'nokogiri'

install the plugin

rails plugin install [email protected]:ychaker/sunspotify.git

from your command line run the following:

bundle install
rails g sunspot_rails:install
rake db:migrate:sunspotify 

== Setup

Make sure you have a current_user method in your application_controller.rb file and that it is under 'protected' and not 'private'

in app/views/layouts/application.html.erb:

add in the head section:

<%= yield :stylesheets %>
<%= yield :javascripts %>

and in the content section where you want the content to go:

<%= content_for?(:content) ? yield(:content) : yield %>

== Search Results

By creating partials in your app/views directory you can override how results are displayed.

The default template can be overridden by creating the following file:

app/views/search/_default_display_result.html.haml

It is suggested to create a template for each model:

app/views/search/_display_result_<model_name_lowercase_and_singular>.html.haml

== Usage

=== Admin

go to:

/admin/search

to add attributes to be indexed. Once models and attributes have been added to be indexed, click the 'reindex' link to reindex your database. I have separated the steps required to get a model indexed in order to allow the admin to add multiple models and fields and then indexing them all at once. Depending on the size of your database, indexing entries make take a while.

=== Search

go to:

/search

to start searching indexed documents. Make sure you have enabled search for at least one model and field from the admin interface.

== Contributors

Youssef Chaker (@ychaker)

Franco Barbeite

== Version

0.1

== Copyright

Copyright (c) 2010 Youssef Chaker, released under the MIT license

Previous:kimchung