diff options
| author | hukl <contact@smyck.org> | 2009-04-28 00:15:53 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-05-01 17:14:02 +0200 |
| commit | 4bd16f053847f2efe347ebda9136ef2233ee0d2c (patch) | |
| tree | f4c11f89455de991c8d87726d5757b752e7129e2 /app/models/node.rb | |
| parent | d3a9b46ba5c863a0ff377dcffae9a494fe476e02 (diff) | |
added thinking_sphinx plugin for fulltext search on nodes and heads
Diffstat (limited to 'app/models/node.rb')
| -rw-r--r-- | app/models/node.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/node.rb b/app/models/node.rb index 98fe94f..4ebb3a7 100644 --- a/app/models/node.rb +++ b/app/models/node.rb | |||
| @@ -17,6 +17,11 @@ class Node < ActiveRecord::Base | |||
| 17 | # Validations | 17 | # Validations |
| 18 | # validates_length_of :slug, :within => 3..40 | 18 | # validates_length_of :slug, :within => 3..40 |
| 19 | 19 | ||
| 20 | # Index for Fulltext Search | ||
| 21 | define_index do | ||
| 22 | indexes head.globalize_translations.title | ||
| 23 | end | ||
| 24 | |||
| 20 | # Class methods | 25 | # Class methods |
| 21 | 26 | ||
| 22 | # Returns a page for a given node. If no revision is supplied, it returns | 27 | # Returns a page for a given node. If no revision is supplied, it returns |
