forked from coryp/as_thinking_sphinx
/
README
51 lines (33 loc) · 1.82 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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