An extension that makes use of the Rails acts_as_solr plugin in Radiant
-
acts_as_solr plugin: multiple forks exist on GitHub, this extension was tested and developed against the mattmatt fork: github.com/mattmatt/acts_as_solr
-
solr: acts_as_solr comes with a pre configured version of Solr (1.3). It is recommended that you use that installation of Solr but if you prefer to run your own or to point to a installation running on a remote server, make sure you use the same schema.xml and solrconfig.xml settings.
-
share_layouts extension: In
/vendor/extensions
run:
git clone git://github.com/radiant/radiant-share-layouts-extension.git share_layouts
Clone the extension from its GitHub repository:
cd /root/to/your/radiant/app/ git clone git@github.com:ychaker/radiant-acts_as_solr-extension.git vendor/extensions/acts_as_solr
Or use the Radiant extension method:
script/extension install acts_as_solr
Copy the configuration file into the /config directory (this has to be done either way!)
cp vendor/extensions/acts_as_solr/aas.yml.example config/aas.yml
then in the aas.yml config file, specify which layout you want the search page to inherit from
After you have setup solr and the acts_as_solr plugin, make sure you edit the config file to your likings:
config/aas.yml
then start the server
./script/server
and the solr server
rake solr:start
then navigate to the search page (make sure you commit an update to the database to ensure an indexing of the tables, or else you will not get back any results on the search)
http://localhost:3000/search
rake solr:reindex returns “There were no models to reindex.”
if you have rows in your db that have already been created and you want them to be indexed run:
./script/console >> Page.rebuild_solr_index
(on all the models you want to reindex, eg. Page, PagePart)
OR…create a new entry and let acts_as_solr’s automatic update handle the indexing
Keywords: stored in db as a string so they are treated as one string in search and are not split in facets.
Facets don’t work with multi_solr_search so won’t show up for All or Page searches
Facet drill down doesn’t work with facets that contain spaces (eg. “Home Page”)
When searching for pages, might get duplicates because Page and PagePart are joined together in the search and some searches will match Page fields and PagePart fields as well and create duplicate results
This piece of software is under the MIT license. Check the LICENSE file for more information.