Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh French committed Jul 28, 2009
1 parent 3793d4b commit 386da18
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions README
Expand Up @@ -2,13 +2,16 @@

Adds ThinkingSphinx [http://ts.freelancing-gods.com/] support to Radiant.

== Usage
== Configuration

Requires the gem version of Thinking Sphinx, available at:
Requires gems for Thinking Sphinx and Will Paginate, available at:
http://github.com/freelancing-god/thinking-sphinx
Once installed, add this line to environment.rb:
http://github.com/mislav/wil_paginate

Once installed, add these lines to environment.rb:

config.gem 'freelancing-god-thinking-sphinx', :lib => 'thinking_sphinx'
config.gem 'mislav-will_paginate', :lib => 'will_paginate'

By default, only the first 8kB of any page's content will be indexed. You can
change this in page_extensions.rb if that's not enough space, or if you wish
Expand All @@ -21,6 +24,32 @@ searchable attribute from within the page edit view if you wish to restrict
certain pages from appearing in the results -- just remember to call
Page.search with +:conditions => { :searchable => 1 }+ if that's the case.

To configure the number of results returned per page, adjust the SearchPage's
@@per_page attribute.

== Getting Search Results

A Page subclass, SearchPage, is provided. This page will accept a +query+ param
and return any published page whose +searchable+ attribute is true. The following
Radius tags are available when building a SearchPage:

* +results+ Opens the search results collection. Use +results:each+ to iterate
over them.
* +results:count+ The total (unpaginated) number of search results, appended
with the word "result" pluralized if appropriate.
* +results:current_page+ The current page of search results.
* +results:total_pages+ The total number of pages of search results.
* +results:query+ The original query. This is escaped for safe display.
* +results:each+ Iterator for the search result collection.
* +results:pagination+ Renders pagination links for the results collection.
Accepts optional +class+, +previous_label+, +next_label+, +inner_window+,
+outer_window+, and +separator+ attributes which will be forwarded to
WillPaginate's link renderer.
* +results:unless_query+ Expands if no query was present in the params. Useful
for alerting on blank GETs to a SearchPage.
* +results:if_empty+ Expands if the results collection was empty. Useful for
alerting users to broaden their search terms, for example.

==============================================================================

Copyright (c) 2008 Digital Pulp, Inc.
Expand Down

0 comments on commit 386da18

Please sign in to comment.