README

Path: README
Last Update: Thu Sep 18 01:00:50 -0700 2008

AAF Search

AAF Search provides search capability using the Acts As Ferret plugin and the Ferret gem.

Version

Initial version 0.1

Requirements

  Ferret gem (tested with v 0.11.4) and acts_as_ferret (0.4.3) installed in the extensions
  vendor/plugins directory. Works with Radiant 0.6.9 and may work with other versions.

Installation

This extension works by creating a new page type called "Search". After you install it and re-start your web server, you should have the Search type available. available.

  1. Download and install just like any other extension.
  2. Migrate your DB: rake [production] radiant:extensions:aaf_search:migrate
  3. Change to the vendor/plugins directory of aaf_search
  4. Install acts_as_ferret, e.g. svn export svn://projects.jkraemer.net/acts_as_ferret/tags/0.4.3/acts_as_ferret
  5. Create a new page called "Search Results" (or whatever you want).
  6. Set the Page Type to "Search" and the Status to "Published"
  7. Create a search form on a page as shown below. The action attribute must be the url of the Search Results page created in Steps 5 & 6.
  8. Visit localhost:3000/my_search_page and enter a search query.
  9. Check your results.

You can exclude pages from the search index by setting the searchable attribute to "Invisible to Search". Currently page types of ArchivePage, ArchiveMonthIndexPage, SearchPage are excluded from the search index, as are pages with layout types of text/css and text/xml. A more robust method of specifying page and layout types to exclude could be implemented.

AAF Search currently has no tests. When the author figures out how to do RSpec testing of an extension he will remedy this situation.

See lucene.apache.org/java/docs/queryparsersyntax.html for more information about query syntax used in Lucene/Ferret.

============================== Search Form ====================================
  <r:search:form action="/search/">
    <r:input />
    <r:submit />
  </r:search:form>
============================== Search Form ====================================
============================== Search Results ====================================
  <h1>Search Results for "<r:search:query/>"</h1>
  <h3><r:search:hits/> found:</h3>
  <r:search:empty>Nothing found.</r:search:empty>
  <r:search:results>
    <ol>
      <r:search:results:each>
        <li>
          <r:link/> (Score: <r:score />)<br />
          <r:highlight />
        </li>
      </r:search:results:each>
    </ol>
  </r:search:results>
============================== Search Results ====================================

License

Released under the MIT license.

Authors

 * Bill Barnard <bill AT barnard-engineering DOT com>

Acknowledgements

acts_as_ferret plugin - Jens Kraemer, projects.jkraemer.net/acts_as_ferret/

Ferret Search Engine - Dave Balmain, ferret.davebalmain.com/api/files/README.html

Search Extension - Oliver Baltzer, Sean Cribbs, github.com/radiant/radiant-search-extension/

Sphinx Search Extension - Josh French, ext.radiantcms.org/extensions/15-sphinx-search/

[Validate]