Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
52 lines (33 sloc) 1.82 KB
Modifications for this version
========
This version has been modified to work with ActiveScaffold for Rails 2.3. Cory's version did not work
due to the params hash not being created in the application stack at the time that the before_filter was
being called on the plugin. Additionally, Cory's version did not clear out the query columns for the controller's
Active Scaffold configuration, and therefore would not properly search on associations in the Thinking Sphinx
configuration for the model being searched due to the full SQL search being performed on all columns for the
search parameter.
ActiveScaffold Thinking Sphinx Adapter
========
as_thinking_sphinx is a simple adapter to allow the built-in ActiveScaffold search to
use the Sphinx search engine as well as the default.
It was created because of the need to search tables with a large number of records.
Prerequisites
========
Sphinx (http://www.sphinxsearch.com/)
Thinking Sphinx (http://freelancing-god.github.com/ts/en/)
ActiveScaffold (http://activescaffold.com/)
Installation
========
This assumes you already have a working Sphinx installation with the Thinking Sphinx gem
installed and running. Your models should already have indexes configured.
script/plugin install git://github.com/coryp/as_thinking_sphinx.git
Configuration
=======
In the scaffold controllers in which you would like to use Sphinx, add the following line
in your active_scaffold config block:
config.search.engine = 'thinking_sphinx'
That's it!
Super-advanced configuration: If you want to specify the model you will be searching on (since by default it is derived from the current controller), add the following option:
config.search.model_name = 'product'
Copyright (c) 2010 Cory Patterson, released under the MIT license
Copyright (c) 2010 Hans Masing, released under the MIT license
Jump to Line
Something went wrong with that request. Please try again.